Forum: Ruby new Ruby implementation?

1b258fd642afa967d154d552eb52539c?d=identicon&s=25 Nokan Emiro (Guest)
on 2014-05-02 15:08
(Received via mailing list)
Hi,

Does somebody know what could be the simplest and fastest way to
build a new Ruby compiler?  There are so many Ruby implementations,
and I'm wondering if there are great tools that make it easy to bring up
just another one.

The first (and most important) thing is a parser.  It would be great to
use
MRI Ruby's parse.y file but I'm afraid that's just to tightly wired to
the
other parts of the implementation.  There's racc too, that could be a
good
way to build my compiler prototype if there would be a Ruby description
written in racc.  (It's a tempting idea to write a prototype of the
compiler
in Ruby...)  Of course, I could write my own parser, but that's
something
that would be great to borrow from other implementations, and just let
me
focus on the output code generation part.  It would be great to use a
parser
that is ISO/MRI compliant out of the box.

What tools do you think are useful for one, who plans to create yer
another
Ruby implementation?  I know RubySpec and mspec, those are almost
necessary to get things right.  But is there anything else that I should
be
aware of?
6738588a11b852833edf6aec90ef6fa3?d=identicon&s=25 Yukihiro Matsumoto (Guest)
on 2014-05-02 17:06
(Received via mailing list)
Hi,

You might feel mruby <https://github.com/mruby/mruby> to be a good
start.   It has 1.9 compliant parser, code generator, VM and class
libraries, yet small.

              matz.


In message "Re: new Ruby implementation?"
    on Fri, 2 May 2014 15:08:01 +0200, Nokan Emiro <uzleepito@gmail.com>
writes:

|Hi,
|
|Does somebody know what could be the simplest and fastest way to
|build a new Ruby compiler?  There are so many Ruby implementations,
|and I'm wondering if there are great tools that make it easy to bring up
|just another one.
|
|The first (and most important) thing is a parser.  It would be great to use
|MRI Ruby's parse.y file but I'm afraid that's just to tightly wired to the
|other parts of the implementation.  There's racc too, that could be a good
|way to build my compiler prototype if there would be a Ruby description
|written in racc.  (It's a tempting idea to write a prototype of the compiler
|in Ruby...)  Of course, I could write my own parser, but that's something
|that would be great to borrow from other implementations, and just let me
|focus on the output code generation part.  It would be great to use a parser
|that is ISO/MRI compliant out of the box.
|
|What tools do you think are useful for one, who plans to create yer another
|Ruby implementation?  I know RubySpec and mspec, those are almost
|necessary to get things right.  But is there anything else that I should be
|aware of?
5a837592409354297424994e8d62f722?d=identicon&s=25 Ryan Davis (Guest)
on 2014-05-03 01:03
(Received via mailing list)
On May 2, 2014, at 6:08, Nokan Emiro <uzleepito@gmail.com> wrote:

> way to build my compiler prototype if there would be a Ruby description
> written in racc.  (It's a tempting idea to write a prototype of the compiler
> in Ruby...)  Of course, I could write my own parser, but that's something
> that would be great to borrow from other implementations, and just let me
> focus on the output code generation part.  It would be great to use a parser
> that is ISO/MRI compliant out of the box.
>
> What tools do you think are useful for one, who plans to create yer another
> Ruby implementation?  I know RubySpec and mspec, those are almost
> necessary to get things right.  But is there anything else that I should be
> aware of?

If you're in the prototype/R&D phase of things and want to quickly whip
together an interpreter, I gave a talk last year that's up your alley:

http://www.zenspider.com/presentations/2013-gogaruco.html

It uses ruby_parser and sexp_processor to put a subset of ruby together
in < 30 minutes.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.