Ruby 2 parser/compiler

Hello,

I was wondering if the Ruby 2 parser/compiler will be written in Ruby.
It could be possible to do so, using at the beginning Ruby 1.9 to run
it and when it is ready, it could compile itself and be run into the
Rite virtual machine. I read that the Perl 6 compiler will be written
in Perl, so why not the Ruby one ?

Vincent Isambart

Hi,

ยทยทยท

In message "Ruby 2 parser/compiler" on 04/08/03, Vincent ISAMBART <isambart@netcourrier.com> writes:

I was wondering if the Ruby 2 parser/compiler will be written in Ruby.

It is possible. But I am not going to do so. Some other guys have
taken similar approach. Google MetaRuby.

              matz.

I was wondering if the Ruby 2 parser/compiler will be written in Ruby.
It could be possible to do so, using at the beginning Ruby 1.9 to run
it and when it is ready, it could compile itself and be run into the
Rite virtual machine. I read that the Perl 6 compiler will be written
in Perl, so why not the Ruby one ?

ByteCodeRuby [1] partially uses this approach. The parser is Ruby
1.8.1's with the internal NODEs then made available to Ruby code using
Ruth [2]. BCR's compiler is written in Ruby and compiles the NODE tree
to its own bytecode format. The bytecode is then run by BCR's bytecode
runner (written in C).

The latest CVS code for BCR moves onto the next stage: rather than
Ruby 1.8.1 running the compiler code, BCR can run it itself from saved
bytecode files. It all gets a bit circular and difficult to describe,
but it does work!

[1] http://rubyforge.org/projects/bytecoderuby/\. The project has been
very sleepy recently, but I'm hoping to make a new release soon.

[2] A (dead?) project of Robert Feldt's. Bundled with BCR.