On Friday, 13 May 2016 at 13:59:57 UTC, Don Clugston wrote:
I think I need to explain the history of CTFE.
Originally, we had constant-folding. Then constant-folding was
extended to do things like slicing a string at compile time.
Constant folding leaks memory like the Exxon Valdez leaks oil,
but that's OK because it only ever happens once.
Then, the constant folding was extended to include function
calls, for loops, etc. All using the existing constant-folding
code. Now the crappy memory usage is a problem. But it's OK
because the CTFE code was kind of proof-of-concept thing anyway.
Thanks for the explanation, and for doing so much work on CTFE.
I would like to work on a solution that does scale.
The Problem is not making a byteCode-interpreter.
That part is relatively easy. Currently I am trying to get a
detailed understanding of dmd and it's data-structures. (mainly
Generating the byte-code seems to be non-trivial.
I wonder in how far the glue layer can be of help...