Paolo Bonzini's blog

Collection idioms in GNU Smalltalk (and problems thereof)

Tagged:  •    •    •    •  

Peter Norvig's blog showed an example of a toy spell checker in Python, which Michael Davies converted to Smalltalk. This problem is interesting and Michael's solution is actually quite idiomatic.

I'll show a couple more tricks that can help decrease the number of lines.

Fun with Cairo and libsdl

Tagged:  •    •    •  

Travis Griggs has been having fun with Cairo and, thanks to the contribution of Tony Garnock-Jones, so am I...

The Cairo and libsdl bindings (Cairo is drawing on a libsdl surface) is not yet in the FSF repository. I'm planning to put up a new git repository with my experiments as soon as possible!

Seaside development with GNU Smalltalk

Tagged:  •    •    •    •    •  

The next release of GNU Smalltalk will include support for Seaside. This blog post is a short tutorial, which will show how to make your first Seaside component.

To follow this tutorial you need GNU Smalltalk 3.0a (which will be available from later today) or a later version.

One of the new features in 3.0a and later is the ability to run an image in the background and control it from the shell. For example, you can try these commands:

$ gst-remote --daemon
$ gst-remote --eval '100 factorial'
$ gst-remote --kill

Sake = Rake for Smalltalk

Tagged:  •    •    •  

A while ago I tried looking at how an object model for a Rake-tool would look like in Smalltalk. Here are the somewhat polished results of that experiment.

One area where Ruby fares definitely better than Smalltalk is in creating DSLs. This is mostly because of the "implied self" of Ruby's syntax, which however is also a major source of complication in parsing Ruby. Therefore, the Sake object model is also an experiment in using class extensions creatively to implement Smalltalk DSLs.

Swazoo runs on GST!

Tagged:  •    •    •    •  

That's it! Swazoo runs on GNU Smalltalk! Code is not yet committed, but it works and passes the entire testsuite.

This script for example will start a web server on http://localhost:8888/

PackageLoader fileInPackage: 'Swazoo'.

Swazoo.Resource subclass: MyResource [
    answerTo: aRequest [
        | response |
        response := Swazoo.HTTPResponse ok.
        response entity: '<h1>Hello World!</h1>'.

site := Swazoo.Site new name: 'test'. "name is just for convenience"
site host: 'localhost' ip: '' port: 8888.

Syndicate content

User login