I constantly feel like inferior languages are picked up, while superior languages are discarded. It's almost as if the universe had a law: "inferior technology is always preferred no matter how hard you seethe".
Examples:
* Python preferred over Ruby
* TypeScript preferred over Dart or even JavaScript (which is fine and, as a bonus, doesn't require compilation step like TS)
* Go is preferred over Crystal and D.
While Python, TypeScript and Go are quite alright, there is no doubt in my mind that their alternatives are absolutely superior as languages. Yes, in case of Dart, Crystal and D the ecosystem doesn't have the abundance of well-tested libraries, but as languages they are simply better. The Go argument that it's popular because it's simpler is absurd in the sense that no one really forces you to write complex code and use classes or other advanced OOP features in D.
old-gregg 15 minutes ago [-]
Languages do not matter as much as you think. Ecosystems are everything. Twice in my life I started companies (the first one took all my life savings) and in both cases the right call was what you called an "inferior language".
I actually liked D very much, and WB had been a personal hero of mine when I was in college. But I am not betting my career on an ecosystem built around by a single brilliant guy. For high-stakes projects, a wise decision is building on a platform with several deep-pocketed backers.
And for toy/personal projects... do you even need a language anymore? Just ask your favorite LLM to generate you an executable which does what you want (partially joking here).
D deserves more recognition. It's a cool language under the radar for too long. I wish a major corporation backed it. I had a great time learning D. Also I admire Walter Bright If I could achieve even a fraction of his productivity, that would be awesome.
creata 2 hours ago [-]
Sincere question, not meant to be a shallow dismissal: Where is D a better choice than C++? In what aspects is it enough of an improvement over C++ to justify using a niche language?
acehreli 1 hours ago [-]
D is technically better than C++ in most features. (It has always lead C++. For example, among about 100 new feauters that C++11 brought, only 2 were not already in D. No C++ designer will ever admit this fact.)
D is safer and more productive. It's a joy to write in D because most of the time it feels like whatever you think, you code. This is unlike C++ where you fight the language all the time. C++ is not a productive programming language. I say this with experience: I coded in C++ as an "expert" for many many years, including these last couple of years. It's not fun to write in C++, which translates to another kind of loss of productivity.
C++ is a burden and liability for companies but no CTO will be blamed for chosing it because it's popular. I can list so many popular things and persons that worth nothing but I will refrain from getting political.
Yes, on paper, there are way more C++ programmers out there than D programmers. But I interview these C++ programmers occasionally. Most of them don't even have an inkling that they don't know C++ at all.
How about engineering with C++? That is such a difficult task. I went over header file hygiene with a colleague a couple of months ago. The number of points that you should pay attention to is mind boggling: Don't #include unnecessarily, do forward declare as much as possible (but what can be forward declared is hard to understand even for experienced programmers), #include your own API header first to prove that it's complete (and good luck!), don't forget header guards, don't reuse header guards, etc. etc. This is just efficient header file usage! We haven't started coding yet!
My friends, the emperor doesn't have clothes. C++ simply is not a tool that is designed well. People who choose it do so because they have to or they are masochists. (True story: I asked a relatively young Google meetup presenter once why he was using C++ instead of a modern language and he said "because it is hard".) C++ separates the elite from the masses; I used to strive to be a C++ elite; I am not interested a bit anymore; I want to write useful programs with D; and I do.
D is niche only because humans are populists. We are not encouraged to use tools (or products) that are designed better. We follow popular leaders. It takes one some time to find his or her own voice to reject bad products and use only good ones. I am extremely lucky to work for a company that allows me to use D to write useful products.
I still take the same joy from programming that I did when I first learned it.
Then there is the human aspect of it: I want to be associated with real people isntead of snobby elites. (Remember how C++ was marketed at around 2000? "Yes, C++ is hard but it was never meant to be for normal programmers anyway." Ha ha ha! I am old enough now to reject that mentality. Bad design is bad design my friends; you can't defend it by blaming the user for not being elite.)
I can go on and on...
Now it's my turn to ask: Why would anyone choose C++ for their projects despite the production costs that it brings? None of your programmers really know it; they introduce hidden liabilities in the projects, their source code become non-refactorable monsters. Why waste that money on C++ when you can produce products easily. Products that just work...
shoozza 4 hours ago [-]
Slightly off topic:
Is D a good language for creating tiny windows or Linux executables?
There is an upcoming game jam (4mb jam 2025) which gives extra points for game submissions <= 8KB.
With c you can fit a window with graphics update in an executable of less than 900 bytes[0]. Granted it's using crinkler for linking which does some compression.
Currently I'm working on adding an AArch64 code generator to the venerable dmd D compiler. It's fun as it's completely differernt from the X86_64. In some ways very clever and in some ways completely wacky.
Daunk 6 hours ago [-]
I feel like D is such an underrated language.
jadbox 3 hours ago [-]
Just to add, I learned D in a day and finished most of project euler without needing to look up the manual. D is more "python" than python in that it makes coding very.
IMHO, Zig is the closest thing to being D-esk (like with comptime), but it's still not a mainstream option yet.
WalterBright 6 hours ago [-]
We're not good at marketing! But we're very good at language ergonomics.
kingbob000 6 hours ago [-]
Love D! I used it a bit in college when it was required for a programming language class. It's hard to justify using it nowadays though.
bsdooby 5 hours ago [-]
Utah Valley University? Or Romania, or Turkey? And why is D's usage hard to justify (because of Rust and/or contemporary C++)?
We have also been using D for computer graphics and game programming as of this year! :D
kingbob000 5 hours ago [-]
Yes, UVU. And also yes. If I find myself needing something low-level and performant, I have a hard time justifying the ramp-up time required to use D since there is a near zero chance I would use it in my current or future employment. While that isn't always how I decide what technologies to use in my personal time, it definitely is a factor that tips the scales towards a more mainstream language
croemer 4 hours ago [-]
Anything compiled with LDC2 >=1.29 (3y old) will immediately crash/segfault on macOS >=15.4
A fix is on master/beta but will still take some time to be released.
Been a heavy user of the language since 2013. This book was very helpful at the time. I don't think it was a book at that time, though, more a lengthy collection of notes as I recall.
Really wanted to like Dlang but I just did not have a good time with it.
One of my projects has a really simple server written in nodejs that's basically (in terms of complexity) just an auth'd chatroom, and I wanted to switch it from using raw tcp sockets to websockets. And since the server is so simple, why not refactor it to another language and see if there's no some performance gains from that. I ended up doing something pretty similar to that "Comparing 10 programming languages. I built the same app in all of them."[0] video from Tom Delalande. I had several working versions of the server in:
- Bun, using Bun APIs[1]
- Dart, using Dart APIs[2]
- Java, using Java-WebSocket[3]
- Kotlin, using Ktor[4]
- Rust, using tokio-tungstenite[5]
- Zig, using websocket.zig[6]
- D, using serverino[7]
And Dlang was, by far, the worst experience out of the lot. Firstly is the lack of adequate, comprehensive, and centralised tooling. I almost gave up when dmd could not even compile the example project. The impression I got is that you're not really meant to use dmd directly, you're meant to use dub, like how you compile Java projects with Maven/Gradle, not javac. Except that there's also apparently three competing compilers[8]? And good luck remembering the names of the tooling because they're all some random three-letter combination.
Serverino makes heavy use of mixins and annotations, which is not ideal, but the only alternative package is hunt-http[9], which has a more preferable API (in my opinion) but hasn't been updated in three years. But what really killed the deal was (despite using the recommended intellij plugin[10] with the recommended tools installed and setup) not being able to inspect serverino's mixin or its annotations. So I look at serverino's source code, except its source also has mixins... which I can't inspect. I'm not going to use something when I cannot easily ascertain its control flow.
I recently read almost the whole book in a week or so. It's excellent and I feel like I can write in D pretty well after reading it. Too bad that I most likely won't be writing in D, but, at least, I'm confident I can come back to it anytime and be up to speed if I ever need to. This book should be the goto for anyone who wishes to quickly learn the language.
bsdooby 5 hours ago [-]
Planning on an update? Some new features made it into the language (I think).
acehreli 5 hours ago [-]
All I need is another wave of motivation. I'm searching. :)
nerdralph 4 hours ago [-]
I tried D several years ago, and liked the language. I didn't stick with it because of the lack of libraries compared to perl, python, C++, etc.
bsdooby 5 hours ago [-]
One of the best language reference manuals out there...
bsdooby 5 hours ago [-]
...could need an update, though.
jpecar 5 hours ago [-]
Is D runtime still crashing when host has more than 128 cpu cores? I learned this the hard way ...
alphaglosined 4 hours ago [-]
Are you talking about "Issue 24254 - LDC crash on Epyc Bergamo"?
That was fixed within the week, with a notification given that it had been sent to the reporter.
5 hours ago [-]
Rendered at 03:54:23 GMT+0000 (Coordinated Universal Time) with Vercel.
Examples:
While Python, TypeScript and Go are quite alright, there is no doubt in my mind that their alternatives are absolutely superior as languages. Yes, in case of Dart, Crystal and D the ecosystem doesn't have the abundance of well-tested libraries, but as languages they are simply better. The Go argument that it's popular because it's simpler is absurd in the sense that no one really forces you to write complex code and use classes or other advanced OOP features in D.I actually liked D very much, and WB had been a personal hero of mine when I was in college. But I am not betting my career on an ecosystem built around by a single brilliant guy. For high-stakes projects, a wise decision is building on a platform with several deep-pocketed backers.
And for toy/personal projects... do you even need a language anymore? Just ask your favorite LLM to generate you an executable which does what you want (partially joking here).
D is safer and more productive. It's a joy to write in D because most of the time it feels like whatever you think, you code. This is unlike C++ where you fight the language all the time. C++ is not a productive programming language. I say this with experience: I coded in C++ as an "expert" for many many years, including these last couple of years. It's not fun to write in C++, which translates to another kind of loss of productivity.
C++ is a burden and liability for companies but no CTO will be blamed for chosing it because it's popular. I can list so many popular things and persons that worth nothing but I will refrain from getting political.
Yes, on paper, there are way more C++ programmers out there than D programmers. But I interview these C++ programmers occasionally. Most of them don't even have an inkling that they don't know C++ at all.
How about engineering with C++? That is such a difficult task. I went over header file hygiene with a colleague a couple of months ago. The number of points that you should pay attention to is mind boggling: Don't #include unnecessarily, do forward declare as much as possible (but what can be forward declared is hard to understand even for experienced programmers), #include your own API header first to prove that it's complete (and good luck!), don't forget header guards, don't reuse header guards, etc. etc. This is just efficient header file usage! We haven't started coding yet!
My friends, the emperor doesn't have clothes. C++ simply is not a tool that is designed well. People who choose it do so because they have to or they are masochists. (True story: I asked a relatively young Google meetup presenter once why he was using C++ instead of a modern language and he said "because it is hard".) C++ separates the elite from the masses; I used to strive to be a C++ elite; I am not interested a bit anymore; I want to write useful programs with D; and I do.
D is niche only because humans are populists. We are not encouraged to use tools (or products) that are designed better. We follow popular leaders. It takes one some time to find his or her own voice to reject bad products and use only good ones. I am extremely lucky to work for a company that allows me to use D to write useful products.
I still take the same joy from programming that I did when I first learned it.
Then there is the human aspect of it: I want to be associated with real people isntead of snobby elites. (Remember how C++ was marketed at around 2000? "Yes, C++ is hard but it was never meant to be for normal programmers anyway." Ha ha ha! I am old enough now to reject that mentality. Bad design is bad design my friends; you can't defend it by blaming the user for not being elite.)
I can go on and on...
Now it's my turn to ask: Why would anyone choose C++ for their projects despite the production costs that it brings? None of your programmers really know it; they introduce hidden liabilities in the projects, their source code become non-refactorable monsters. Why waste that money on C++ when you can produce products easily. Products that just work...
0: https://gist.github.com/ske2004/336d8cce8cd9db59d61ceb13c1ed...
IMHO, Zig is the closest thing to being D-esk (like with comptime), but it's still not a mainstream option yet.
A fix is on master/beta but will still take some time to be released.
https://github.com/dlang/dmd/issues/21126
One of my projects has a really simple server written in nodejs that's basically (in terms of complexity) just an auth'd chatroom, and I wanted to switch it from using raw tcp sockets to websockets. And since the server is so simple, why not refactor it to another language and see if there's no some performance gains from that. I ended up doing something pretty similar to that "Comparing 10 programming languages. I built the same app in all of them."[0] video from Tom Delalande. I had several working versions of the server in:
- Bun, using Bun APIs[1]
- Dart, using Dart APIs[2]
- Java, using Java-WebSocket[3]
- Kotlin, using Ktor[4]
- Rust, using tokio-tungstenite[5]
- Zig, using websocket.zig[6]
- D, using serverino[7]
And Dlang was, by far, the worst experience out of the lot. Firstly is the lack of adequate, comprehensive, and centralised tooling. I almost gave up when dmd could not even compile the example project. The impression I got is that you're not really meant to use dmd directly, you're meant to use dub, like how you compile Java projects with Maven/Gradle, not javac. Except that there's also apparently three competing compilers[8]? And good luck remembering the names of the tooling because they're all some random three-letter combination.
Serverino makes heavy use of mixins and annotations, which is not ideal, but the only alternative package is hunt-http[9], which has a more preferable API (in my opinion) but hasn't been updated in three years. But what really killed the deal was (despite using the recommended intellij plugin[10] with the recommended tools installed and setup) not being able to inspect serverino's mixin or its annotations. So I look at serverino's source code, except its source also has mixins... which I can't inspect. I'm not going to use something when I cannot easily ascertain its control flow.
---
- [0] https://www.youtube.com/watch?v=-MbTj8DGOP0
- [1] https://bun.sh/docs/api/websockets
- [2] https://api.dart.dev/stable/latest/dart-io/WebSocket-class.h...
- [3] https://github.com/TooTallNate/Java-WebSocket
- [4] https://start.ktor.io/p/ktor-websockets
- [5] https://docs.rs/tokio-tungstenite/latest/tokio_tungstenite/i...
- [6] https://zigistry.dev/packages/karlseguin/websocket.zig/
- [7] https://code.dlang.org/packages/serverino
- [8] https://wiki.dlang.org/Compilers
- [9] https://code.dlang.org/packages/hunt-http
- [10] https://wiki.dlang.org/IDEs
That was fixed within the week, with a notification given that it had been sent to the reporter.