[squeak-dev] Running Squeak fro ma unix shell script file with #! squeak...

tim Rowledge tim at rowledge.org
Mon May 6 00:22:16 UTC 2019



> On 2019-05-05, at 2:32 PM, David T. Lewis <lewis at mail.msen.com> wrote:
>> 
>> Wait, you've actually got it running squeak and trying to load something? How? It doesn't get as far as Squeak on my Pi.
>> 
> 
> I'm actually having a hard time dredging this out of deep backing store
> from my grey matter, but a couple of things do still work (just in Squeak,
> not in the grey matter).
> 
> Following the tip from Chris Cunnington, I read the squeak man page. That
> covers the idea of the self-executing script, which should work fine once
> we fix the deprecation issue and re-teach the script loader to skip over
> the first line of a script file that begins with '#!'.

Hmm, well we have some interesting problems here. Like *which* man page does one pay attention to, and does it even faintly reflect reality?
For example, on a Pi running the Debian derived Raspbian OS, `man squeak` produces something quite different to the version on squeakvm,org, but the version on github/opensmalltalk appears at first glance to be the same and 9 years untouched. The -help info from a recent Cog vm is quite different in its list of options. I also stumbled over some very out of date info on the swiki about running squeak on Debian.

On my Pi, attempting to run a file like this - 
--------------------
#!/usr/bin/squeak --

| t  f |
t:= [f := 4784969 fastDoublingFib asString] timeToRun.

FileStream stdout
	nextPutAll: 'fib(4784969) = '; 
	nextPutAll: f; 
	cr; 
	nextPutAll: 'time = '; 
	nextPutAll: t asString; 
	nextPutAll: ' mS'; 
	cr
--------------------
Results in
++++++++++++++++++++ 
./ReallyFastFib.st 
FileStrenextPutAll: 'fib(4784gFib asString] timeToRun.
Usage: /usr/lib/squeak/5.0-201610101924/squeak [<option>...] [<imageName> [<argument>...]]
       /usr/lib/squeak/5.0-201610101924/squeak [<option>...] -- [<argument>...]

ALSA <option>s:
  -nomixer              disable mixer (volume) 
...{snip lots of hrelp option info}
+++++++++++++++++++++

The strangely garbled line of Smalltalk is particularly amusing.

I have tried various combinations, including naming the image file explicitly, passing things off to another shell script that names the image file and so on. No luck so far. Actually manually running `squeak my.image ReallyFastFib.st` works as one would currently expect, getting to where the code loader barfs over the #!.

Evidently we have some serious drift that needs sorting out, as well as actual functional problems. And I suppose one should wave a flag and point out that the way squeak is 'supported' in Debian repositories is horrible and years outdated and perhaps worse, appears to carefully mangle the vm code. It's been that way for ages. If anyone has contacts in the appropriate places perhaps we could get it sorted out?

> 
> The other thing that still works is taking an image file and prepending
> it with 512 characters of gunk before the actual image, in which the first
> part of those 512 characters is a shebang line.

I remember that; I might have even used in the deep past. I'm amazed it would still work.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Nostalgia:  The good old days multiplied by a bad memory...




More information about the Squeak-dev mailing list