[Seaside] Using javascript toolkits for smalltalkers

Lukas Renggli renggli at gmail.com
Mon May 14 06:20:12 UTC 2007

Hi Sebastian,

>     I, as a lot of people, are using the excellent job you made "mapping"
> Scriptaculous to enjoy javascript smalltalkishly. As you where able to make
> such a thing I wanted to ask what is your opinion about the starting point
> of such kind of work for other toolkits for smalltalkers. I mean, I have
> some years on smalltalk and I'm a newbie in javascript and I want to have an
> idea of what to expect of the development in the formula
> smalltalk+javascript. I know results are great, but I want to understand
> more deeply the "path" to them.

first I must say that the Scriptaculous package is not entirely my own
work, Avi started it all back in June 2005. In the beginning there was
just basic AJAX functionality and some effects. The evolution of
Scriptaculous was a highly iterative process. While I tried to add
more functionality, and eventually supported all the things available
trough JavaScript, I also had to rethink and redesign the the
Smalltalk object model several times to accomodate new needs.

The most difficult thing was that JavaScript is a prototype based
language, even though most libraries (including prototypes (sic!) and
script.aculo.us) mostly use it like a class based system. So the first
thing to notice is that the Smalltalk object hierarchy does not
necessarily reflect the structure of the code on the JavaScript side.
For example there were some conflicts in SUAjax and SUAutocompleter,
where some Smalltalk objects understand messages they shouldn't. I
guess this is not really a problem, and if necessary it could be
cleanly solved using some well known technique that should not be
mentioned in the Seaside mailing-list ;-)

Apart from that the integration was strait forward. Every JavaScript
method has a Smalltalk equivalent + some Smalltalk glue code. I added
a lot of unit tests to make sure the transformation works as I
expected. Also nice is to have a functional test suite that makes sure
that the JavaScript code works as expected and, at the same time,
serves as an example for users of the library.

>     To be honest I'm interested in a couple of widgets of the dojo
> javascript toolkit but I don't want to mess arround until I get it, so if I
> want to "map" a smalltalkish access to them into Squeak for instance, which
> should be my starting point? how the normal cycle of development should be
> (I mean debugging things that are not in st debugger, javascript tutorials
> that are good to smalltalkers, etc)?

I would just start with something simple that works and then refine it
on the go. I am sure that you can take some ideas from Scriptaculous
and maybe even build on top of it reusing its serialization scheme.

The JavaScript debugger is FireBug (www.getfirebug.com).


Lukas Renggli

More information about the seaside mailing list