Squeak success story - Scripting for people without shell access.

David Mitchell david.mitchell at gmail.com
Fri Apr 6 18:41:51 UTC 2007


I know probably everyone on this list has shell access on their box.
Most of us are developers, but I was reminded recently that not
everyone is in this boat.

At my work, a friend of mine in marketing needed a batch file. He
didn't know he needed a batch file, but he was doing a lot of manual
folder creation, copying, and renaming. He asked me for advice since
he knows I'm a geek.

I honestly was about to write him a DOS batch file and I noticed he
didn't have shell access. That also ruled out ruby, perl, etc for me
(since I don't know how to build something in those languages that
would run in something other than a shell).

He *could* run squeak (lucky for me I had a flash drive with Squeak on
it to test).

Later that evening, I decided to write something up in Rio. I started
with one of Pavel's kernel images and tried to load from there. Kept
getting the traits loading problems (which I thought would work in a
3.9 kernel) and I gave up on Rio without getting too far.

I really like the style of the messaging in Rio. Also, the wiki pages
on Rio are very helpful and helped me learn enough of FileMan to be
dangerous.

Anyway, ended up writing a little class that was the equivalent of my
batch file. Tested it and it worked fine. FileMan isn't as cool as
Rio, but the code I wrote was very simple.

To deliver the code, I put a Go button on the desktop and left my #go
method up in a browser. I bundled up Squeak.exe and an image, which
zipped to about 8MB. I didn't include sources or changes. 8MB is
ridiculous for a batch file, but my friend in marketing didn't mind. I
just handed him a flash drive and we copied it to his desktop.

Mind you, he'd never seen Squeak, Smalltalk, or any other programming
IDE. I had him associate the .image with Squeak and he knows to double
click the image. It opens up and he clicked Go.

With the color pretty-printer, he could see where in the script the
folder names were and he was able to change the folders around.
Learned he needed to save his changes and save the image. We made a
few modifications and up popped the debugger. Since I was still there,
I showed how to diagnose the problem and we continued. I'd love to say
continue worked, but since it was in some file primitive, we had to
restart from the top.

His thoughts...

Nothing about the 8MB

Nothing about the weird GUI

Just,  "This is so cool."

Was nice that the Squeak environment made it easy to build an ad-hoc
GUI (browser + button) that worked for scripting even if he was
"barred" from the shell.



More information about the Squeak-dev mailing list