Benjohn Barnes wrote: >Another example would be creating a parser from a BNF like notation. >It should be possible (making use of this module) to specify a >grammar with a Rubyish domain specific language, and then compile >that to native code and immediately make use of it from within the >same Ruby program. > > I had exactly this idea recently! I was particularly interested in lexing, because that's the bottleneck in some parsers I've written recently. And conveniently, re2c (google it) is an existing re->c compiler that generates optimized C from a regular expression description. Sounds perfect for the task. >A further possibility is that it could pull all that pesky linking >with external libraries (well I don't get on with it anyway, but it's >not really my bag) in to the domain of Ruby, and make it a fun thing >to explore from within IRB, for example. An offshoot from that would >be an explorative SWIG like system: a simple c parser that you can >point at a library's header file, allowing you to start hacking about >with the c library as if you were back programming BASIC on your BBC >[2] :) > > Wow, I had this idea too -- except I had the idea of getting function signatures from a .so's debugging information, so you wouldn't need the C header file. I'm really interested in any work you do in this area. I'd like to be working on this, but I am heavily invested in other problems at the moment. Regards, Josh