[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

embedding a language into Ruby

Friedrich

6/13/2005 12:16:00 PM

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.
4 Answers

Austin Ziegler

6/13/2005 12:36:00 PM

0

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?

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
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca


Joel VanderWerf

6/13/2005 5:01:00 PM

0

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 %{ }.


Steven Jenkins

6/13/2005 5:34:00 PM

0

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




Friedrich

6/14/2005 5:41:00 AM

0

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.