embedding a language into Ruby

  • Thread starter Friedrich Dominicus
  • Start date
F

Friedrich Dominicus

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
 
A

Austin Ziegler

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?

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
--=20
Austin Ziegler * (e-mail address removed)
* Alternate: (e-mail address removed)
 
J

Joel VanderWerf

Friedrich said:
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 %{ }.
 
S

Steven Jenkins

Friedrich said:
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
 
F

Friedrich Dominicus

Joel VanderWerf said:
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
 

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
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top