Embedding a language into Ruby

Well I hope the question is clear. Let us assume one want to develop a
new language but use the existing Ruby infractructure. Do you know
anyone having worked in that area? Do you know an example of such a
use of Ruby?

Regards
Friedrich

···

--
Please remove just-for-news- to reply via e-mail.

You'll have to live with the constraints of the Ruby language,
certainly, but there are several examples. RHDL is an example of a
high level definition language for circuits; rake and rant implement
make-like semantics (almost another language) in Ruby. My own
PDF::Writer includes a print-oriented language for creating brochures
and quick reference sheets.

-austin

···

On 6/13/05, Friedrich Dominicus <just-for-news-frido@q-software-solutions.de> wrote:

Well I hope the question is clear. Let us assume one want to develop a
new language but use the existing Ruby infractructure. Do you know
anyone having worked in that area? Do you know an example of such a
use of Ruby?

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Friedrich Dominicus wrote:

Well I hope the question is clear. Let us assume one want to develop a
new language but use the existing Ruby infractructure. Do you know
anyone having worked in that area? Do you know an example of such a
use of Ruby?

There have got to be lots of examples. My own project, redshift, is an embedded language for specifying the behavior of hybrid automata (discrete transitions plus differential equations). There are a number of tricks you can play with blocks, instance_eval, and class methods to make your syntax look nice. Sometimes you have to resort to strings, but even then you can make them look nice with %{ }.

Friedrich Dominicus wrote:

Well I hope the question is clear. Let us assume one want to develop a
new language but use the existing Ruby infractructure.

By "infrastructure", do you mean everything (lexer/parser/runtime/libraries) or something less? Using racc, you can connect a grammar for any language you like to the Ruby runtime and libraries. That's not quite the same as building a domain-specific language in Ruby itself, a la Rake, etc. But it's an option.

Steve

Joel VanderWerf <vjoel@path.berkeley.edu> writes:

Friedrich Dominicus wrote:

Well I hope the question is clear. Let us assume one want to develop a
new language but use the existing Ruby infractructure. Do you know
anyone having worked in that area? Do you know an example of such a
use of Ruby?

There have got to be lots of examples. My own project, redshift, is an
embedded language for specifying the behavior of hybrid automata
(discrete transitions plus differential equations). There are a number
of tricks you can play with blocks, instance_eval, and class methods to
make your syntax look nice. Sometimes you have to resort to strings, but
even then you can make them look nice with %{ }.

Well I would like to not start all the machinery but use mostly Ruby,
with some extensions. But if that turned out to be not "good enough",
I have to consider the larger possibilities.

Regards
Friedrich

···

--
Please remove just-for-news- to reply via e-mail.