On Thu, 13 Jun 2002, FranÝđis D˝─helle wrote:
> Mathieu Bouchard wrote:

> This looks good. How big is the Ruby interpreter ?

the raw meat is:

size /opt/lib/libruby.so.1.6.7 
   text    data     bss     dec     hex filename
 615869    7576   56788  680233   a6129 /opt/lib/libruby.so.1.6.7

with all the fat (debugging info) it's doubled:

ls -l /opt/lib/libruby.so.1.6.7 
           1471217 jun 15 13:28 /opt/lib/libruby.so.1.6.7*

the interpreter has many loadable .so and .rb files; there are 8.6 megs of
it right now on my system, but i suspect half of that is debugging
symbols, and anyway i installed many plugins myself.

> Does it have its own garbage collector ?

Ruby has had mark-and-sweep garbage collector for many years now; in
comparison, Perl and Python still only use reference-counts. In a
real-time system there might be an advantage to using reference-counts,
but that advantage is meagre as long as the object-count is low, as it
would be for something like FTS/GridFlow. (if you have to many objects at
once, upgrading to Ruby 1.7 makes things smoother, but Ruby 1.7 is still
marked experimental)

> Another point: it looks like metaclass do not fit into standard object
> oriented languages. May be an indication that it is not the right
> concept.

jMax/FTS's idea of metaclass is different from SmallTalk's and Ruby's idea
of metaclass.

In SmallTalk, the split between classes and metaclasses is done so that
the functionality of classes is reused at a second level. "class methods"
and such are defined in metaclasses, just like "object methods" are
defined in classes. So there are two parallel hierarchies, one rooted in
the Object class, and the other rooted in the Class class.

In Ruby it is similar, though there is the added concept of singleton
classes for adding methods to specific objects, and that's what
metaclasses are implemented with.

The biggest mismatches I see between jMax and others are: peculiarness of
metaclasses, lack of inheritance, lack of method_missing (the wildcard
method), and of course, a dataflow model of operation.

Note that emulating jMax's metaclasses is not a problem in Ruby. It can be
done mostly within a page of code, by creating anonymous subclasses at
runtime and storing them in a Hashtable. I've done very similar things in
the past in other Ruby projects. The main difficulty will be writing the C
part for connecting with jMax, but that's because when programming for
jMax I've always limited myself to ordinary classes.

________________________________________________________________
Mathieu Bouchard                   http://hostname.2y.net/~matju