[Mono-list] Making a ruby.net compiler

Erik Bågfors erik@bagfors.nu
08 May 2003 10:34:31 +0200


On Thu, 2003-05-08 at 07:52, sho tamashii wrote:
> I have a couple of questions. How do I go about making a compiler for
> a language, specifically the Ruby Programming Language? This Language
> has Dynamic Typing and other high level features. How would I go about
> implementing this? Do you have any documentation or compilers that I
> can look at to get a good idea of how to start? If I make the ruby
> compiler or what ever it will be, do I have to do anything extra to
> allow Ahead of time compilling.
>  

It would be really great if you could get a ruby compiler for the .Net
platform but I think that's a very hard goal to reach.  Ruby is a very
dynamic language and a lot of things can't really be done at compile
time.

So you pretty much need a compiler which will dynamically compile part
of the program at run-time.  After that you need to rewrite all of the
ruby core libraries in C# (or another .Net language)

Also the .Net platform is really not optimal for dynamic languages.

A more realistic goal for starter would be to integrate the ruby
interpreter and mono.  Much in the same way as activestate has done with
perl.  That way you could call .Net classes and code from ruby and the
other way around but it would still be two runtimes running at the same
time.

I believe one of the ximian guys has an example on how to do this for
perl.

I personally believe that a much more interesting goal would be to get a
ruby compiler running on the perl6 vm known as parrot.  Unfortunately
parrot isn't enough far ahead for that... yet

Lastly.. have you checked this out?
http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/nrb.html


/Erik

-- 
erik@bagfors.nu
fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32