static map as a type function
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Sep 24 05:38:07 UTC 2020
On Thu, Sep 24, 2020 at 03:04:46AM +0000, Stefan Koch via Digitalmars-d wrote:
> On Thursday, 24 September 2020 at 02:42:00 UTC, Paul Backus wrote:
> >
> > On the other hand, if you can fix recursive template bloat somehow
> > (tail-call elimination?), you get good performance *and* nice code.
> > It's the best of both worlds.
>
> good performance yes.
> But where is the nice code, when you are confined to recursive
> templates?
What we need is imperative syntactic sugar that lowers to recursive
templates under the hood. (After all, in theory, every Turing-complete
language is just syntactic sugar over lambda calculus. :-P)
That, plus implement template optimization schemes to lower the cost of
recursive templates. The template analogue of tail-call optimization is
a good first step, for example. Another good direction to investigate
is instantiation elimination: i.e., defer the actual instantiation of a
template (with its associated costs of copying the AST and substituting
arguments, generating symbols, etc.) until it's determined to be
necessary.
T
--
Many open minds should be closed for repairs. -- K5 user
More information about the Digitalmars-d
mailing list