<div dir="ltr"><div>We have a compile time problem, and this is basically the cure.</div><div>Intuitively, people imagine CTFE is expensive (and it kinda is), but really, the reason our compile times are bad is template instantiation.<br></div><div><div></div></div><div><br></div><div>This DIP single-handedly fixes compile-time issues in programs I've written by reducing template instantiations by near-100%, in particular, the expensive ones; recursive instantiations, usually implementing some form of static map.<br></div><div><br></div><div><a href="https://github.com/dlang/DIPs/pull/188">https://github.com/dlang/DIPs/pull/188</a><br></div><div><br></div><div>This is an RFC on a draft, but I'd like to submit it with a reference implementation soon.</div><div><br></div><div>Stefan Koch has helped me with a reference implementation, which has so far gone surprisingly smoothly, and has shown 50x improvement in compile times in some artificial tests.</div><div>I expect much greater improvements in situations where recursive template expansion reaches a practical threshold due to quadratic resource consumption used by recursive expansions (junk template instantiations, and explosive symbol name lengths).</div><div>This should also drastically reduce compiler memory consumption in meta-programming heavy applications.</div><div><br></div><div>In addition to that, it's simple, terse, and reduces program logic indirection via 'utility' template definitions, which I find improves readability substantially.</div><div><br></div><div><div>We should have done this a long time ago.</div><div><br></div><div>- Manu</div><div></div></div><div></div><div></div></div>