It is the year 2020: why should I use / learn D?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Nov 14 19:23:59 UTC 2018


On Wed, Nov 14, 2018 at 05:44:35PM +0000, Stefan Koch via Digitalmars-d wrote:
[...]
> newCTFE will blow away constexpr in perfomance!

Can't wait for newCTFE to be ready... any updates on the schedule?


> and when I have time for it, D will get type-manipulation abilities
> which are much more efficient than what you can do with templates.
> 
> it'll be faster to compile.

I want to hear more about this.  D's templates are darned powerful, and
the syntax is far more readable (and writable!) than C++'s, but for
certain use cases, like manipulating AliasSeq's (aka "type tuples") it's
just not the right idiom, and often leads to quadratic or even
exponential template expansion, which causes template bloat and often
dog-slow.

Sometimes I find myself wishing that types were first-class compile-time
"variables", and that you could write code that manipulates them
directly, e.g., append a type to an array of types from inside a foreach
loop, which is much more readable (and writable!) than a recursive
template that you have to use today.


T

-- 
Answer: Because it breaks the logical sequence of discussion. / Question: Why is top posting bad?


More information about the Digitalmars-d mailing list