What I'd love to see in Squeak

David T. Lewis lewis at mail.msen.com
Sun Feb 1 16:31:58 UTC 2004


On Sun, Feb 01, 2004 at 01:41:31AM -0500, Aaron Lanterman wrote:
> 
> > I think that you may find Squeak to be an ideal medium for exploring,
> > analyzing, and simulating electrical engineering ideas. It is fully
> > capable as a computational tool, but is also highly interactive, visual,
> 
> Speaking from the ECE angle (maybe some of these already exist as a
> Goodie somewhere, in which case pointers to them are appreciated):
> 
> 1) I'd love a read-eval-print-loop that acts like all the other
> read-eval-print-loops I'm used to. This business of selecting text and
> hitting alt-P or ctrl-P or whatever is driving both me and Sarah (the
> student I have working with me) nuts for some reason. I want to type a
> line, hit return, and have the result print on a new line. I want to be
> able to hit the up arrow to select previous inputs, and use some sort of
> completion to refine that, like in MATLAB.

Well, just to show the concept you can load CommandShell from Squeak Map.
It is intended mainly for running external OS commands, but if you just
enter Smalltalk expressions you will find that it evaluates them in its
read-eval-print loop.

But this is just a novelty, you don't really want to work this way.
Instead, try doing an "interactive session" like this:

 - Open a Workspace.
 - Enter all your "commands" in the workspace, saving the results in
   variables in the workspace (a workspace will automagically define
   temporary values and keep them for you, so you can just do something
   like "myTempVar := MyClass doSomething" and the result will be kept
   in myTempVar for later use in the workspace).
 - As you work, write lots of comments in the workspace, along with the
   expressions that you evaluate. Enclose your comments in double quotes
   so they look like Smalltalk comments, and so you can evaluate whole
   chunks of the workspace (including the comments) later on. Often the
   comments will just be notes to yourself to remind you of what and why
   you were doing something.
 - If you have done something that you want to save or show to someone
   else, you can save the workspace to a text file and do whatever you
   want with it. Or if you want to modify or justwant to re-run your
   "interactive session" later on, it will all be there in the workspace
   waiting for you.

> 2) A standard multidimensional array class, built into the image, that
> everyone can depend on and use in a consistent way. Squeak arrays as far
> as I can tell are 1-D. (Maybe I'm confused on that and someone can help
> me.)
> 
> If you want Squeak to win the Hearts and Minds of ECEs, or engineers in
> general, having a built-in suite of linear algebra operations would be a
> good thing. I'd love to see MATLAB type functionality in Squeak, where I

Some very interesting work has been done in Argentina. I don't know how
current this work is, but you will certainly want to take a look at it:
  http://mate.dm.uba.ar/~caniglia/mathMorphs.html
  http://mate.dm.uba.ar/~caniglia/Linear/index.html

See also the Algebraic package on Squeak Map:
  http://map1.squeakfoundation.org/sm/package/c1e8846e-11f4-4f2f-9fd1-8984f43417a8

> 3) As an aside, I've sometimes wondered if it might be a good idea to give
> options for alternate syntaxes, which could be translated on the fly to
> standard Smalltalk syntax - people could type code in a form they're more
> accustomed to, and see it translated into standard Squeak code. Then
> after they get comfortable seeing that, they may start typing more and
> more in standard Squeak right away. Squeak with syntactic sugar - maybe
> call them "SugarSqueaks." There could be "SugarSqueakFortranStyle,"
> "SugarSqueakCStyle," etc. or something like that.

In Squeak, set the printAlternateSyntax preference
(world menu->appearance...->preferences...->browsing, then click on the
printAlternateSyntax checkbox). Open a new browser and have a look at some
methods. I think that Dan Ingalls implemented this a while back as an
experiment.

> Basically, the shock of the initial appearance of Smalltalk has prevented
> me from seriously exploring it for over a decade. (Well, that and you
> could get Turbo Pascal for the IBM PC for $99, and who knows how much a
> commercial Smalltalk from ParcPlace cost back them). Of course, Scheme
> looked freaky the first time I saw it too, but I got over that.  (It's
> probably an experience issue, but it takes me a _long_ time to read a
> piece of Squeak code and figure out what it does, relative to, say, Python
> or Pascal or whatever. I will probably get faster at it.)
> 
> So, I'm wondering how to help others get over that initial shock, so they
> don't just say "what the hell is this, this looks very cryptic" and not
> dig further to find the good stuff.

I had exactly the same problem. I do not have a good answer to this, other
than to say that the shock begins to dissipate after about a year or so,
and after that things become quite pleasant.

Dave




More information about the Squeak-dev mailing list