On Wed, Apr 22, 2020 at 11:35 PM Manu <turkeyman@gmail.com> wrote:
On Wed, Apr 22, 2020 at 11:20 PM Steven Schveighoffer via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On 4/22/20 8:04 AM, Manu wrote:
> We have a compile time problem, and this is basically the cure.
> Intuitively, people imagine CTFE is expensive (and it kinda is), but
> really, the reason our compile times are bad is template instantiation.
>
> 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.
>
> https://github.com/dlang/DIPs/pull/188
>
> This is an RFC on a draft, but I'd like to submit it with a reference
> implementation soon.
>
> 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.

Yes please! Where is the reference implementation? I want to try some
things out.

The link is in the DIP.
Most tests we've done are working, except template instantiation expansion is not yet implemented: ie, Thing!(Tuple, x, y)...
That's got a lot of implementation baggage attached to it in DMD.

Stefan worked out how to make the TemplateInstance case work. The branch is updated, and it's working now!!
If you wanna do some tests, it'd be really interesting to see how much it helps your code, and also help find edge cases and bugs.