3 ms·
D has generics and compiles fast. There are probably other examples too. The overlooked thing is rustc produces poor quality LLVM IR which is also mentioned in
by entha_saava 6y ago
D has generics and compiles fast. There are probably other examples too.
The overlooked thing is rustc produces poor quality LLVM IR which is also mentioned in FAQ.
And generics reduce amount of manual for loop juggling code one has to write. I don't think adding generics makes much of a difference.
- 59nadir 6y ago> The overlooked thing is rustc produces poor quality LLVM IR which is also mentioned in FAQ. LLVM is also slow in general. If you use it, it's likely the thing that's bottlenecking your language's compile-time unless you've done something insane like templates and `#include`, etc.. Inevitably it's the case that even if your source language doesn't do nearly as badly at the design stage when it comes to generics as C++ does, if you use LLVM your build stage is probably going to be unacceptably slow.
- entha_saava 6y ago> LLVM is also slow in general. Agreed. But so is GCC. And I guess many of the 'zero cost' abstractions require some advanced optimizing compiler like LLVM to be zero cost (or move that complexity to compiler end). They specifically mentioned the technical debt and poor LLVM IR Generation issue though. I wonder if it has yet gotten attention or fixed. Maybe @pcwalton knows.
- chubot 6y agoOK sure, now write your own backend or use one other than LLVM (which one?). Now you're going to learn about a different set of tradeoffs.
- entha_saava 6y agoGo and D made the tradeoff. And both have good compile times. Both of them have GCC and LLVM frontends as well as a homegrown one. And homegrown ones have fast compile times. Edit: well fast compile times at the expense of optimization. But that kind of proves the point.