Visitors Who Steal Ruby Off to New VMs #
Avi: So I wrote a visitor that does the least work possible to translate the simplest Ruby program possible into something Squeak Smalltalk can load and run, and hey, it adds 3+4 and comes up with 7.
He’s talking about his smalltalk.rb, which translates this code:
class HelloRuby def zot 3+4 end end
Into this code:
Object subclass: #HelloRuby instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Ruby'! !HelloRuby methodsFor: 'ruby' stamp: ''! zot ^ 3 + 4
Neat. You know, I think NodeVisitor would be a really great tankshed RCR.
FlashHater
Oh wow. Stealing the visitor patern from java and using it to make Smalltalk. What will the world come to next?
_lynX
An end.
bish0p
_lynX: hopefully it started with a
Peter Cooper
He has a great point about the speed of the StrongTalk VM though. From what I’ve read, it flies. I downloaded the source, eager to have a play, before discovering it’s all Windows-fied.. eugh. Perhaps when someone with more knowledge than me gets it running on a proper operating system it’ll be an exciting VM to target? Pushing it through JRuby doesn’t seem like a real solution.
fidd
can’t wait to see ruccola in action for comparison!
protoscript
bishop, you’re awesome!
zenspider
FlashHater: visitor pattern stolen from… java?
zenspider
_why: so, while hanging out with Avi at OOPSLA we talked about this and I got cracking on ruby2smalltalk.rb using ParseTree. I’ve got 60 failing testcases to go (you can inherit the tests from ParseTree and ensure full coverage) but it is already turing complete and translating runnable things like fib to smalltalk…
I’ll be doing a public release soon.