3 ms·
D seems to have a lot of strengths as being less complex than C++, and I have heard great things about it. It seemed to be a better C++ rather than a low-level
by eggy 5y ago
D seems to have a lot of strengths as being less complex than C++, and I have heard great things about it. It seemed to be a better C++ rather than a low-level C. Is that mostly a true statement? Is Bartosz Milewski still a member of the design team?
- int_19h 5y agoThe way I'd describe it is, it can easily be as low-level as C - stack-allocated arrays, unions, pointer arithmetic etc, even inline assembler - but the object-oriented layer on top of that is more similar to C# or Java than to C++; hence why I thought about it when you mentioned Scala. It's in a spot similar to Go, in that it doesn't have a VM, but is normally used with a garbage collector (the core language can do without it - the libraries are another matter, though). However, unlike Go, it doesn't adopt the "less features and more boilerplate is better" approach to PL design. OTOH it does have templates (not just generics) every bit as powerful as C++ ones and then some - but also with fewer footguns, and overall easier and more pleasant to use. You might also find it interesting that the D compiler has a mode that is specifically called "BetterC", which basically removes all features that are dependent on the D runtime library (GC etc): https://dlang.org/spec/betterc.html https://dlang.org/spec/betterc.html
- eggy 5y agoThanks for the informative reply. I'll have to try the BetterC mode. Scala Native allows you to do all the low-level stuff in the syntax of Scala with Java and C libs available that logically work at that level. Obviously, JVM-dependent libs will not work when you're bit banging with Scala Native. I just picked up the, "Systems Programming with Scala Native" book, which is promising for what I want to do. I just don't have any experience with it on real systems project yet...