On Wednesday, 21 September 2016 at 17:14:34 UTC, Stefan Koch
That can and is being fixed.
Templates can only be fixed partially and I am not even sure of
I am not suggesting to remove templates.
I just want to raise awareness that they have a rather high
CTFE performance is fixable. Template performance might not.
Thinking about templates and CTFE, is part of the performance
issue due to immutability? Compare std.meta.Reverse vs
static if (TList.length <= 1)
alias Reverse = TList;
alias Reverse = AliasSeq!(Reverse!(TList[$/2..$]),
void reverse(Range)(Range r) if (isRandomAccessRange!Range &&
immutable last = r.length-1;
immutable steps = r.length/2;
for (size_t i = 0; i < steps; i++)
If we are able to get a bytecode CTFE interpretor, it seems like
the same technology could be used to "run" templates like Reverse
which only serves to compute a "value" rather than declare a new
function or type, and perhaps be able to write a function like
reverse which uses mutation and apply it to an AliasSeq in a