2 ms·
Compilers decreasingly encounter parses that depend on template instantiation, as users move to new constexpr alternatives to template metaprogramming. So the
by ncmncm 5y ago
Compilers decreasingly encounter parses that depend on template instantiation, as users move to new constexpr alternatives to template metaprogramming.
So the right implementation choice, for the compiler, is to bull ahead with the common case, and throw the result away and try the other path if you get to an inconsistency. Such inconsistencies practically never happened in production code anyway, and where they did it most usually was, and now almost always is, a result of a bad edit.
So the practical expense is keeping and then GCing old state as it expires, which reduces to stack-like memory management, a solved problem.
We have not needed to go to JITting compile-time constructs, (though it could still happen to expedite constexpr evaluation). Rust might need to, soon, to accommodate parsing under influence of macros, a chore growing with time, not shrinking. (I.e., produce a new parser for each macro added, and jump into it to finish the parse.)