Squeak SSP-- huh?
Nevin Pratt
nevin at smalltalkpro.com
Wed Apr 3 18:24:48 UTC 2002
I've been playing around with the SSP stuff at
http://ssp-squeak.swiki.net, and quite frankly, I'm at a loss at
understanding what good it is.
Well, it's a totally different animal than the SSP work that Alan Knight
did for VW. For one thing, you write your "Active Smalltalk Pages" in
the Class Browser instead of using external files. Hmmm, that might
even be useful, except for the way it works.
OK, I type the example from the swiki into the browser (any class):
**************
serveletExampleOn: strm
<ssp on: strm>
This is an example servelet method. I can embed code in this
string as follows: <%= (1 + 1) printString %>.
**************
I then "accept" the method, and... voila! The method magically changes
to normal Smalltalk code of (I am using Squeak 3.2gamma):
**************
servletExampleOn: strm
strm nextPutAll: 'This is an example servelet method. I can
embed code in the string as follows: ',
(1 + 1) printString sspStreamOn: strm.
strm nextPutAll: '.
'
**************
(in case anyone is curious, the implementation of #sspStreamOn: is just:
strm nextPutAll: self)
Now, the problem with the above is that if I had wanted it to convert my
original HTML/SSP source string to pure Smalltalk code, I would have
written it in pure Smalltalk in the first place. It doesn't preserve my
original code *at all*. Nor is there apparantly any easy way to feed it
an arbitrary string read in from an external file.
Now, if you compare this to the work that Alan did with VW...
...with Alan's work, I can have my 12 year old son do HTML pages with
Dreamweaver (my son's tool of choice), and then gradually introduce him
to embedded Smalltalk code within his HTML pages, thus giving him a
gradual introduction to Smalltalk.
I don't see any way of doing anything like that with the Squeak SSP
stuff. For that matter, I have a hard time seeing any use for the
Squeak approach *at all*. I would just write Smalltalk code rather than
let the SSP parser convert my HTML/SSP code to Smalltalk for me.
Anybody have contrasting points of view? I'd love to hear from you.
Nevin
More information about the Squeak-dev
mailing list
|