------art_8807_14251788.1178230363711
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 5/3/07, SonOfLilit <sonoflilit / gmail.com> wrote:
>
> 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.



I've written compilers for high-level languages before that targeted C
rather than ASM. It's not a bad approach, if you understand how C is
optimized. It's possible to generate C that will compile to something pretty
fast. Although these days, memory-bus bandwidth is a much more constrained
resource than it ever was in the past (mostly because everything else has
gotten so much faster), and that adds a level of complexity.

Is the point of this to get better performance? Not if you keep the
essential Ruby features (open classes and all the rest).  Is the point to
save typing? Maybe, but I've always found that the vast majority of the time
spent in writing C goes not into typing but into either planning or
debugging. (The more planning you do, the less debugging, and vice versa.)

------art_8807_14251788.1178230363711--