04 gennaio 2011

Smalltalk and Ruby

from the agile dept.

This is my post in the attempt to embrace the Smalltalk way of doing things. In the process, I'm following Davide's course.

The power of Smalltalk is due to the language and its environment, that of course has a bunch of native, old-style C-code for its VM. The question I want to answer is: how much power is hidden in the VM and how much in the ST part? Is the VM hiding something to us?

Let's compare the ST VM to the Ruby VM. Why Ruby? Because the Ruby and ST object models are very similar, and some principles are shared between the two - however, the Ruby syntax is far more verbose (e.g. 40 keywords vs 6 of ST). And because both are written in the old-school C language.

How big is the Smalltalk VM (SqueakVM for instance) compared to Ruby (MRI)?

squeakvm/win32 r2249

22006 .c LOC
33404 .h LOC

ruby 1.9.2 p136

722475 .c LOC
32253 .h LOC

hey, RubyVM's about 30 times bigger than SmalltalkVM! This is a raw evidence that the power of Smalltalk is not in the native/C part but in the Smalltalk part (surprise!?).