4 ms·
I have to say, I like what I read there. I'm glad they're working more on c++ interoperability. I've ported some c++ code to D before, it wasn't not too bad, it
by grawprog 7y ago
I have to say, I like what I read there. I'm glad they're working more on c++ interoperability. I've ported some c++ code to D before, it wasn't not too bad, it wasn't a lot of code, but it would be great to be able to work directly with c++ libraries in D similarly to C libraries.
It always makes me sad D hasn't picked up more. Usually comments I see about D seem pretty ambivalent to dismissive. It's a great language and to me has always felt like the way C++ should have been.
It does seem to be growing in popularity. Even in the years I've been using it, the number of libraries and community resources has expanded exponentially and every day new code is being added to
https://code.dlang.org/ https://code.dlang.org/
Not to mention dub is probably the most simple straightforward build system I've worked with.
- tempsolution 7y agoThe main reason that D hasn't been picked up by anyone is mostly because it is an evolution of C++, not a revolution. Discarding an entire ecosystem for an evolution is not going to happen. Rust took a very different approach and just threw everything away. D looks and feels too much like C++, I would rather have hoped that effort would have been spent on making C++ better.
- einpoklum 7y ago... and over the past decade-and-a-bit, C++ has been evolving itself quite nicely (IMHO), so the motivation for moving away from it has decreased. Also, now D probably has to "chase" some C++ developments.
- pjmlp 7y agoThe problem is that while modern C++17/20 are quite productive, we cannot get rid of C copy-paste compatibility and the errors of the past (see Python 3). So either you work alone, in a small team that appreciates modern safe C++ (including Core guidelines), and enjoy C++, or you are faced to deal with all idiocrasies and unsafety issues from the past.
- einpoklum 7y agoWell, it's not quite that dichotomous. It's quite possible to gradually modernize, or "beautify", an older-C-style codebase. And actually, having a transition path from older to newer code without a cliff is an advantage to switching languages.
- pjmlp 7y agoI agree, however that modernization is only possible if the team actually buys into it, hence my remark about working alone or in a small team that embraces modern C++.
- jstimpfle 7y agoThat's funny. I like to beautify old C++ codebases by gradually moving them to C. Code is so much easier to read already without implicit member accesses (this->). When going through large codebases, that must be one of the most frequent questions I'm asking myself, "is this a global, local, or member variable?".
- pjmlp 7y agoAh the beauty of use-after-free and memory corruption issues. /s
- jstimpfle 7y agoTry to find one here: https://github.com/jstimpfle/language https://github.com/jstimpfle/language Not every project can be written 100% in this style, but the problem is very often programmers trying to mimick C++, e.g. doing object oriented fine-grained initialization/destruction stuff in C.
- pjmlp 7y agoWill actually have a go at it. As Google, Microsoft, Apple, Amazon have been reporting in multiple occasions, the problem goes beyond programmers trying to mimick C++. To the point that future Android versions will require hardware memory tagging enabled on ARM devices.
- grawprog 7y agoIt might look like c++ but I can't say it 'feels' the same. The lack of header files in D immediately jumps to mind. D's module system is totatlly different from C++'s preprocessor. Ranges and slices are a big part in D programming that's a fair bit different than the way things are usually done in C++. Interfaces, Classes, structs are handled differently. The similarities are more surface deep once you start learning more about the different features and tools D offers.
- petre 7y agoNot really, it doesn't feel like C++. D fixes many C++ annoyances, has a GC, doesn't have the annoying preprocessor, header files. Walter Bright did try to make C++ better, remember that D came along after he wrote the Digital Mars C++ compiler. C++ has also improved in the meantime.
- p0nce 7y agoI have programmed in both for years (commercially) and don't understand the comments about D being like C++. This is a night and day difference to me.
- he_the_great 7y agoIt is less about how it feels and more about how it looks. And appearance really only changes when you hit templates. And with D you can't tell (as an outsider) so it just looks like the non templated C++.