From: Bart Masschelein Date: 2005-09-04T19:46:04+09:00 Subject: Re: Ruby compilers (for DSP processors and alike) >So then I had an idea: why >not write a DSL (domain specific langauge) using Ruby that would allow me >to bypass some of the tedium. The DSL would be used to describe the >dataflow. That description would then be translated to the Matrox API (C >code). > > So what is such a DSL exactly then? In your case, it is a Ruby piece of code which is translated into C, which uses the Matrox API? Or is there more behind the piece of code you give here, which is part of the DSL, like a convertor to replace a specific Ruby line of code into specific C lines of code? >So for example I could do things like this (to the best of my memory): > >require 'gencode' >include GenMatrox >Description.new { > Task { > cam1 = Camera > b1 = Buffer(640,480) #allocate an 640X480 video processing buffer > halfsize = Buffer(320,240) > b1 << cam1 #capture camera output in b1 > halfsize << b1.zoom(0.5) #zoom in > } >}.to_c > > > >Maybe you can give us a little more info about what you're doing? I >would think about the DSL approach I described above - it might be a fit >for what you're doing. I know similar >approaches have been used to define assemblers in Ruby and assemblers are >pretty low-level. > > Where could I find more information on this issues? It would be interested to have a look at these. Thanks, B.