On Wed, 30 May 2001, Stefan Matthias Aust wrote: > Glen Starchman <glen / enabledventures.com> wrote: > > >After doing some digging and (re) discovering Smalltalk, it seems to me > >that one option for creating a JVM version of Ruby might be greatly > >simplified. Turns out that the vast majority of Ruby functionality can > >be duplicated in Smalltalk. > > That would be definitely an option. I'd vote for Squeak as it comes > with full sources, even for the VM. So you could even modify the VM > if that should be needed (probably for frozen objects). The > semantics of Ruby and Smalltalk are very similar, so a lot of > internals of the Smalltalk system could be reused. Especially reusing > the Squeak GC - which is quite good - would be a great time safer. What about GNU Smalltalk? Not being a Smalltalk expert I can't verify its completeness, but so far it seems very robust to me, much moreso than the GNU SmallEiffel implementation. Plus, of course, you end up with the complete source. > The disadvantage is that you can simply forget the compatibility to > the existing extension API. That's the tradeoff that Jython had to make.... You want to use an existing Python C extension? Rewrite it in Java. Your functionality isn't supported by Java? Tough luck. I think that using a language other than Java, preferably one that allows for a closer integration with the underlying OS (while masking some of the idiosyncracies) is ideal. Hence my Smalltalk suggestion. >The Smalltalk VM is a stand alone > application which is much more difficult to extend with C code. Is it? I don't really know, but the manual for GNU Smalltalk has what appears to be a fairly simple example of extending the JVM and another for embedding within a host container. Since I don't have the necessary expertise to evaluate the examples, perhaps someone else would care to look at it? > >Obviously the syntax is radically > >different, but a smart parser should be able to transate Ruby to > >Smalltalk, and then use a Smalltalk to JVM compiler. > > But... The latter doesn't really exist either. There's bistro, but > that's more a Java with Smalltalk syntax and I know two companies who > tried to create a Smalltalk VM simulated on a JVM. > Hm... I have heard of Bistro, but never used it. I was (mistakenly) under the impression that there were several such products. > So my suggestion would be to use the Smalltalk VM to actually run > Ruby. > Not a bad idea at all. And, it literally would only take a matter of hours to implement the majority of the core Ruby classes. Even I, with little Smalltalk expertise, managed to get a very rough Smalltalk implementation of the Ruby Collection class built in a couple of hours. Yet, once again we get into the clash with the parser. GNU Smalltalk comes with a Lisp (and a Prolog!) interpreter that is surprisingly fast and complete with only a couple hundred lines of code. Obviously Lisp syntax is radically simplified compared to Ruby, but... More food for thought.