6 ms·
D sure looks like the language everybody "C++" actually wanted, if they only knew they wanted it. I actually include myself in that camp, so thanks for taking
by childintime 4y ago
D sure looks like the language everybody "C++" actually wanted, if they only knew they wanted it.
I actually include myself in that camp, so thanks for taking the stage :D
- cyber_kinetist 4y agoThe reason D didn’t really gain traction over the years was because it required a garbage collector. Recently it’s going the other direction via betterC (a mode where you can ditch the GC), but many parts of the standard library still require the GC to run properly.
- pjmlp 4y agoC# hasn't had the same issues, https://www.wildernesslabs.co/ https://www.wildernesslabs.co/ https://nikolayk.medium.com/getting-started-with-unity-dots-part-1-ecs-7f963777db8e https://nikolayk.medium.com/getting-started-with-unity-dots-... Had Remedy experiment worked out, maybe DOTS would be using D instead of having their own compiler infrastructure for HPC#. Nor Java even, https://www.ptc.com/en/products/developer-tools/perc https://www.ptc.com/en/products/developer-tools/perc https://www.aicas.com/wp/products-services/jamaicavm/ https://www.aicas.com/wp/products-services/jamaicavm/ The main reasons are not having a big name company that would push D no matter what, and lack of focus where D should aim for.
- WalterBright 4y agoD is a general purpose programming language, it does not aim at a niche.
- pjmlp 4y agoIt is called killer feature for market adoption.
- WalterBright 4y agoVery, very little of the library requires a GC. You can ensure your D code doesn't use the GC by adding the `@nogc` attribute. But really, all this concern about the GC is misplaced. It's just another tool available. You can use it in D, or use RAII, or your own allocation system. It's your choice as a D programmer.
- teleforce 4y agoIt is a shame that until now the software industry has not figure out how to reliably perform automatic memory management or GC. Unlike the auto industry the manual transmission is going to a dinasour route compared to the now default automatic transmission. I am giving this analogy since Walter has a degree in mechanical engineering and he has correctly made the GC a default in D but not mandatory, but the choice somehow is not popular in the software industry.
- pjmlp 4y agoSadly it took too much time, and lost momentum. C++ version int squares1[4] = {0, 1, 4, 9}; // doing it by hand std::array squares2 = [] { std::array<int, 4> a; for (int i = 0; i < 4; i++) a[i] = i * i; return a; } (); // doing it with CTF Is as pretty? Not as much, but it does the job.
- WalterBright 4y agoOk, try this one: string cat(string s) { return "int " ~ s ~ ";"; } int test() { mixin(cat("i")); return i + 3; }
- pjmlp 4y agoFor that one D gets one point, even though Circle C++ might be able to do it, it isn't ISO C++. So what if D wins at code golf against C++? What matters is being good enough for most compile time use cases, while enjoying the large ecosystem and IDE tooling, perfect is the enemy of good.
- WalterBright 4y agoThe ability to use CTFE to generate strings that can then be fed back into the compiler is a heavily used feature, not just a golf point. It enables the creation of mini-DSLs.
- pjmlp 4y agoYou tend to praise D features, while ignoring that a language on its own doesn't make an ecosystem. Indeed C# and C++ don't give me all nice features from D, when doing language comparison tables, D wins on that table listing. Yet they give me their library ecosystem, graphical IDEs, and first day avail on any major company SDK. I will take that productivity win over the few features that the D language happens to have. Why is Andrei Alexandrescu helping to improve C++ at NVidia instead of using D, when the language is so great? Ecosystem, that is why.