Michael Malone
4/6/2009 9:47:00 PM
James Coglan wrote:
>> Well that's part of it. But, if by "generating bytecode from another
>> language" means, for instance, executing JVM bytecodes, I don't think it
>> will fly. The term bytecode here is being used rather generically. The YARV
>> "bytecodes" aren't the same as the JVM bytecodes, any more than
>> Smalltalk-80
>> bytecodes are the same as either..
>>
>> Getting another language to produce YARV bytecodes would be an exercise for
>> the reader.
>>
>
>
> I meant that I'd like to try and generate YARV bytecode from non-Ruby
> source. Mostly a pie-in-the-sky idea, only just writing my first AST-walking
> interpreter, just wondering if it's possible.
>
>
It's definitely possible. I suggest you take a look at the parrot
interpreter. It is a one-for-all interpreter (well, that's the aim,
anyway), which began life as an April Fool's joke that someone took one
step further. It officially hit version 1.0 the other day, so it should
be a good example for you. By one-for-all I mean, it's a generic
interpreter that can handle many languages, much like .NET and the clr,
I guess.
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================