Am I the only one that thinks OP is looking for a library to assist in
generating ascii C code, like Markaby does for HTML, and not for
executing C code that you wrote as a string?

Brad, I don't think you'll find one, and in fact, I don't think you'll
need one. Why? C has so much syntax that you're better off generating
it with string manipulation than with a DSL.

HTML is so simple that there was more gain (succintness,
automatability) than loss (new language to learn) in Markaby and it's
neighbours. With C, I don't see such gains overcoming the loss.

Aur

On 5/2/07, Joel VanderWerf <vjoel / path.berkeley.edu> wrote:
> Brad Phelan wrote:
> > Just curious,
> >
> > is anybody working on a C language DSL that could generate C code. I'm
> > kinda interested in how it may be possible to use RSpec to unit test C
> > code in a nice way.
>
> Here's one:
>
> http://raa.ruby-lang.org/project/cgenerator/
> http://rb-cgen.darwinports.com/
>
> There's an example at:
>
> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/170530
>
> IMO, cgen's shadow class mechanism is what differentiates cgen from
> RubyInline. (Shadow classes give you an easy way of defining and
> inheriting T_DATA structs as if they were just part of your ruby
> classes, using the shadow_attr_accessor methods.) RubyInline is probably
> more sophisticated in many ways (compiler options, storing intermediate
> code securely, availability as a gem).
>
> I've been using cgen since 2001 for boosting the performance of
> numerical integration and simulations. I've also used it to wrap some
> libraries that I didn't want to bother with swig for.
>
> --
>        vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
>
>