4 ms·
D is horribly slow to compile template-heavy code for exactly the same reasons as c++. And it encourages lots of monomorphization in e.g. ranges. The enhanced
by moonchild 5y ago
D is horribly slow to compile template-heavy code for exactly the same reasons as c++. And it encourages lots of monomorphization in e.g. ranges. The enhanced introspection and reflection (and CTFE) capabilities coupled with mixins also encourage code that is very slow to compile.
- WalterBright 5y agoNot really. For example, D templates are never parsed more than once. The trouble is, people use templates more and more until they hit compile speed problems. I'd argue that this limit is much higher in D, but the end result is similar.
- munificent 5y agoJust like nature abhors a vacuum, my experience is that regardless of how fast your compiler is, user programs will grow to until they reach a point where they are annoyingly slow to compile.
- mpweiher 5y agoSolution: drastically lower your annoyance threshold. You'll be more grumpy but much more productive. I get antsy when my test suite takes more than a second or so.
- mhh__ 5y agoAs opposed to encouraging manually written code which is also not free to compile but has the added benefit of potentially introducing bugs?
- moonchild 5y agoAs opposed to encouraging polymorphic code (a la haskell, java), which is fast to compile and provides better type safety. (Yes, I know neither javac nor ghci are particularly fast, but that doesn't detract from the general point.)