Meta / CTFE library

Matthias Walter Matthias.Walter at st.ovgu.de
Mon Jun 23 07:38:27 PDT 2008


Robert Fraser Wrote:

> Matthias Walter wrote:
> > as I'm doing much stuff with CTFE / Template Metaprogramming, I thought about collecting important stuff in a library. I already found the following interesting:
> > 
> > 1. parsing routines for compile-time; although every standard lib has their parsing routines, but sometimes they don't work at compile time (e.g. using some libc-stuff), or at least are not optimized for this use. This includes parsing / printing numbers as well, because at least for dumping some numbers, while debugging a CT-program, one needs these quiet often. Everyone, who read Dons BLADE library, will know his enquote() function. This one is very important if you like to do some recursive mixin programming, like he did there.
> 
> I'd love to see a compile-time language parser infrastructure. There's 
> already code (BCS's) that takes an EBNF grammar and generates a runtime 
> code parser, but what about something that can create a (semi) efficient 
> compile-time parser (that is, given an EBNF grammar and a code string, 
> create some compile-time structs of the syntax of the code string, which 
> can then be used to generate other compile-time code).

This sounds crank - although interesting, but I guess, this won't be my main target for the library, cuz I didn't want to code a meta-meta-lib :) But it is possible: One could write templates / ctfe functions which generate the code for the compile-time parser and you must mix it in then... Why does one need a compile-time-parser, if I'm allowed to ask?!



More information about the Digitalmars-d mailing list