I’ve been in Japan for 4 weeks now and my time here is not going to waste… between Japanese classes, I’ve been flirting with ocaml, scala, c (I read the K&R book) and now Smalltalk (with Squeak). My casual language survey is coming to an end, with no more obvious omissions, I would think. (covered before: Haskell, Erlang, Scheme and Common Lisp … and this goes without mentioning the others I touched: Python, Perl, Ruby, C++, Java)
No language is perfect. Performance seems indirectly proportional to expressiveness. This is the intuitive answer … and sadly, the one I found experimentally.
I mentioned before my list of programming exercises I try once I get past the introductions and tutorials. Always working on the same problems really helps understand the idioms of a new language.
I tried to code Tower of Hanoi and “benchmark” the time it takes to execute them for a few languages.
Tower of Hanoi, 20 rings:
* Ruby: ~20 seconds
* C: ~1.2 seconds
* OCaml: ~5 seconds
* Scala: ~16 seconds
* Haskell: >2 minutes … stopped it at that point
As for Smalltalk … this is a whole other story. The main motivation is Seaside, of course. Smalltalk is interesting in itself for many reasons:
- You can see where Ruby got its inspiration
- You can experience what object orientation really means
- You can try “crazy” stuff like switching the garbage collector on the fly …
- You can experience the-language-is-the-environment-is-the-IDE, which seems like both a blessing and a curse
I’m trying to get to the point where I can write a few webapps in Seaside and see if my whole world is transformed. If you want to understand “why Seaside”, you can watch The Heretic Web Framework – Seaside. The idea of continuations and the idea of assigning code blocks to hyperlinks (instead of named goto: URLs) are definitely something worth investigating.
It doesn’t mean that Smalltalk is a destination… it’s just one of the stops along the way.