What are AST Macros?

Don nospam at nospam.com
Tue Jul 13 03:13:52 PDT 2010


bearophile wrote:
> Don:
>> CTFE isn't intrinsically slow. The reason it's so slow in DMD right now 
>> is that the treatment of CTFE variables is done in an absurdly 
>> inefficient way.
> 
> Are those arrays managed like immutable arrays in a functional language? :-)

*Everything* is done with copy-on-write. It's not an appropriate way to 
implement mutable variables in an interpreter.

> To implement mutable arrays with an immutable data structure you need a GC designed for it (like the Haskell one) and a different underlying implementation, like a finger tree, that avoids most of the copying and allocations :-)

Yes, and even that would never work very well for a D interpreter.


More information about the Digitalmars-d mailing list