Compiling to Heap for CTFE

BCS ao at pathlink.com
Tue Dec 18 14:02:49 PST 2007


Reply to Don,

> 
> Some simple suggestions that would be major leaps forward in practical
> CTFE
> programming are:
> * gc at compile time, to stop the symbol table getting clogged up.

a re working of the symbol table system would help a lot. With nested template, 
I see no reasons that the data of the base template should be copied for 
every sub template. IMHO it should be carried by reference, alos the full 
name should never be built until it needs to be output. Lastly for large 
char[] terms in templates some form of slicing would cut down a lot on memory 
usage.

But what do I know, I've never written a full compiler. (just a lexer and 
a parser that won't compile because it's make DMD use to much ram :)

> * some version statement to detect if you are in CTFE. This would mean
> (a) you could create CTFE-able versions of code that uses (for
> example) asm
> at run-time; and far more importantly:
> (b) you could insert printf/writefln statements in the non-CTFE
> version, for
> assistance with debugging.





More information about the Digitalmars-d mailing list