4 ms·
I did C++ for over 10 years, and now have been doing rust for about 4. On the whole, I like rust much better, but I really miss header files. Modules are horri
by emtel 1y ago
I did C++ for over 10 years, and now have been doing rust for about 4. On the whole, I like rust much better, but I really miss header files.
Modules are horrible for build times. If you change an implementation (i.e something that would not normally involve editing a header) the amount of rebuilding that happens is crazy, compared to any C++ project that was set up with a minimal amount of care.
- WalterBright 1y agoD modules are very fast. Many of our customers rely on D being way faster than C++ to compile.
- feelamee 1y agoI often hear about a lot of advantages of D. So I don't understand why it is so unpopular. Probably I need to give it a chance, but I'm unsure that I will find a real job with the D stack.
- WalterBright 1y agoKnowing D will make you a better programmer in other languages. For example, D pushes you to write better encapsulated modules, which is a transferable skill.
- dzdt 1y agoMost languages that have made it big have been the primary language for a platform that made it big, and it is really the features of the platform more than those of the language that have driven that.
- tialaramex 1y ago> Most languages that have made it big have been the primary language for a platform that made it big, I think you're going to want to define "made it big" and then make yourself some lists as this to me sounds like it doesn't have much explanatory power.
- will4274 1y agoD is fine. Like many languages that postdate C++ and Java, it made better choices, learning from the past. But it doesn't really have a differentiator.
- emtel 1y agoHow does D avoid the problem I described?
- WalterBright 1y agoFor one thing, it never has to compile a module more than once, no matter how many times it is imported. For another, the compilation of a module is done on demand. For a third, D modules can be "header only", omitting the implementation.
- mtoner23 1y ago[flagged]
- WalterBright 1y agoThey tell me, I don't need to think it.
- karmakurtisaani 1y agoWhat kind of argument is that? It's like an ad hominem, but in some weirdly complementing way.
- deleted 1y ago[deleted]
- epage 1y agoWhat was it about headers? In terms of rebuild performance in defining the interface vs implementation, there is interest in having rustc handle that automatically, see https://rust-lang.github.io/rust-project-goals/2025h2/relink-dont-rebuild.html https://rust-lang.github.io/rust-project-goals/2025h2/relink...
- emtel 1y agoThat change sounds like a big improvement if they manage to do it!
- jjmarr 1y agoChanging the private module fragment (equivalent of a source file) shouldn't cause rebuilds since it doesn't change the interface.