Ruby 2 parser/compiler

  • Thread starter Vincent ISAMBART
  • Start date
V

Vincent ISAMBART

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
 
Y

Yukihiro Matsumoto

Hi,

In message "Ruby 2 parser/compiler"

|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.
 
G

George Marrows

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top