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.