Hacker News new | ask | show | jobs
by janislaw 1031 days ago
Having two competing standard libraries didn't help with the adoption.
1 comments

Seriously, the competing library problem is stale news. It might've contributed to things stalling a long time back, but I think the main reason right now perhaps is due to no mainstream FOSS software that is used by a large population being written in D. Nowadays, there are too many alternate choices in capable languages with more backing and some of them have more mind-share like Go and Rust and Zig. Mostly Rust perhaps. And C++ is catching up. D doesn't really have a niche where it might be a good language to use.
"D doesn't really have a niche where it might be a good language to use."

I'm wondering if metaprograming would be a niche D could exploit. I have yet to find a systems language with the same introspection and code generation capabilities (minus JAI but its non public). Though not sure what business use case that would fall into... You are right C++ is catching up, Andrei Alexandrescu has a talk that about proposing changes to constexpr to effectively recreate D's static if so he can do Design by Introspection in C++ (https://www.youtube.com/watch?v=tcyb1lpEHm0)

--Examples/more info--

They literally have a "function" that takes in a regex and spits out D code that then gets compiled in to the executable.

https://www.youtube.com/watch?v=HdzwvY8Mo-w DConf 2017 Day 3 Keynote: Design by Introspection -- Andrei Alexandrescu

https://www.youtube.com/watch?v=0lo-FOeWecA DConf Online 2021 - Metaprogramming in D - Bradley Chatha (this one gives a great overview + quick dive into what D meta programing can do)

https://dlang.org/phobos/std_traits.html

Since C++20 that DbI is possible in C++, although not as nice as D, or as Andrei would like it to be.

By making use of constexpr if and concepts.

Yet another example of how D has missed to mainstream languages, that eventually got a good enough alternative, with a much rich and mature ecosystem.

Right, but D burned some of its very valuable growth time stagnating, and probably turned a lot of people off from D. It's a nice language now, but how many people never did (and will never now) give it a chance because of the "standard" library?