From: Michael Neumann Date: 2005-02-16T19:37:13+09:00 Subject: Re: Ruby as a domain specific language? Phil Tomson wrote: > RHDL (Ruby Hardware Description Langauge) - a language for describing > hardware (and simulating concurrency). See: > http://www.aracnet.com/~ptkwt/ruby_stuff/RHDL/ I add mine: Ruby for logic formulas: http://www.ntecs.de/viewcvs/viewcvs/ForSys/ I actually split the DSL into two parts. The "clean"-part, where I use "regular" Ruby constructs and the other part where I make heavy use of const_missing and method_missing, this generates objects of classes defined in the "clean"-part. Clean: Impl[ ForAll[ Var[:x], Pred[:P, Var[:x], Var[:y]] ], Exists[ Var[:y], Pred[:Q, Var[:y]] & ForAll[ Var[:z], Pred[:R] ] ] ] "Un-Clean": V::x { P(:x, :y) } >= E::y { Q(:y) & V::z { R() } } Both is actually valid Ruby! Regards, Michael