The mess that were the competing stdlibs and the transition to D2 made me lose interest. I've looked at it again from time to time and it just feels too... big. It does too much.
I can get what I wanted from the D1 days with C# AoT now (it also has too many features but they have more obvious use cases and it has a much larger ecosystem).
I really don't see much use in a C++ but saner and with a GC. I'm sure someone has that use case, but not me particularly. And for the "statically typed high-level language with a GC" Java, C# and Go can do it with massively larger ecosystems backing them up.
There might be a future in the BetterC D subset or if they find a way to go after the Rust market with a more C++-like language but even for that I'm a lot more bullish on Herb Sutter's cppfront.
I honestly don't know what they can do to get a breakthrough. Walter Bright is appropriately named and there's a lot to like in D, it's just lacking a direction and an audience IMO.
Speaking personally: I tend to work best in languages which imply a particular mental schema for expression and structuring. Not that Python is always a poster-child for this, but as the Zen of Python says, "there should be one and preferably only one obvious way to do it". Ironically, by being limited a good language can get out of your way by allowing you to focus on your problem rather than exploring a massive solution space of how best to express it. For me, anyway.
D isn't a language like that; it seemingly operates under the assumption that any feature must be good - if D has all the features of C++ AND D has all the features of Rust AND D has all the features of Java AND D has all the features of Haskell AND...why use all those other languages when you could just use D? It's guaranteed to have what you need! And there's certainly room in this world for languages like that - and there's plenty of them - but they're not for me.
Python is a poster-child for this, getting more and more features and complexity as it grows, while it used to be very simple in the early days.
The problem is that becoming a kitchen sink language is a result of becoming popular, and not the path there. With the exception of languages with an ecosystem tied to them (like C/C#/Swift/JavaScript, even PHP with Apache), nearly every language that got popular had a strong message behind it and focus.
Even C++ started as C+Classes with zero-cost abstractions. Java was write once run everywhere. Rust was memory safety without GC. Haskell was functional programming taken to the limit.
D is just a pile of features at the moment, and that's just not enough. I have the same issue with Nim to be fair to Walter.
D sees optional GC as the best of both worlds, but IMHO this is only another axis on which the language is fragmented, and casts doubt whether the language and ecosystem is fully committed to supporting absolutely-no-GC users.
Golang has probably taken over D's GC niche, and Zig is competing with -betterC.
They know where they want to go, and stand by their decisions no matter what.
Isn't that what Nim kind of is?
What i like:
- fast to compile
- C like syntax
- modules
- slices
- metaprogramming
- compile time type introspection
- independent devs
What i don't like:
- maintainers seems to run in circle, they are scared to improve the language therefore they do nothing to improve it
- no vision
- they no longer seem to view D as a system language
- lacks features to enjoy D as a true "betterC" language
D is nice if you like C but hate headers, they unfortunately chased high level languages for too long, and it shows (EH and GC), language became depend on the two too much, making them unable to capture the system programmers
What's sad is even the high-level languages managed to catch up, as you've mentioned with Go, C# NativeAOT and Java's GraalVM
Web Assembly for example, to target it you have to create a object.d and copy paste bunch of Type Info and hooks... it's been like that for years and they didn't bother improving it, how can you be taken seriously.. system side of things got neglected
Then you have the allocator API that still is marked 'experimental', you can't ignore Exception Handling for your errors
Years after years, whenever you try to mention those issues, they always find ways to either ignore or to remind you that you should fix things yourself
Overall D is a nice language, there are much better languages if you want to target system level stuff, and there are much better languages if you want to target high level stuff
The fact that people mention using D instead of Python is just sad.. relegated as a mere alternative to an interpreted language
The language lacks leadership, it needs a reboot, 3rd time is the charm, just like Python right? ;)
I’m not sure these are really a competition or a threat to anything. Go is eating C# and Java’s lunch precisely because these 2 solutions are no where near good enough in the real world.
Choco one of the best constraint solvers around now compiles with GraalVM and exposes a C-API callable from Python. Try that in Go.
But if I'm loading a constraint solver into my Python app I don't want it to drag a massive JVM around and take 3 seconds to load up. Same with an emulator, most emulators load up in milliseconds.
Why are is so many people saying this, as it doesn't seem to be true. At lest from what I have seen so far. I know that theoretically jitted can be faster, in in practice it's almost never. From C# benchmarks I have seen, in case jitted is faster than AOT, it's only by minuscule few percent. But when AOT is faster it is often a lot faster. And I am not talking about startup time.
Some apps get poorly reviewed due to slow startup time
Also 3sec on your dev machine = 10sec on regular machines
Don't be like Microsoft, don't pretend 9 seconds is fast startup time :)
https://www.youtube.com/watch?v=CT7nnXej2K4
"10MinuteMail shared how they used GraalVM and Spring Boot 3 to reduce their startup time from ~30 s down to about 3 ms, and memory usage from 6.6 GB down to 1 GB, with the same throughput and CPU utilization."
https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee0117...
Zig is similar in that regard, if you don't use the LLVM backend it is stupidly fast despite the insane amount of metaprogramming it supports.
BTW, there are several D compilers:
- DMD (the de-facto compiler written by Walter). Previously written in C++, now is self-hosted. It has it's own code codegen.
- LDC (using LLVM)
- GDC (using GCC)
HN Algolia search should find some.
Also are NativeAOT and GraalVM replacements for a language like D when they limit access to their respective languages' library ecosystems?
I think comparison to Python is a plus. Python is loved because of its flexibility and ease of use. One of D's strengths is the degree of flexibility and ease of use it maintains while offering much greater performance than Python.
I do agree that language improvements can be slow but I don't believe it is because maintainers are afraid. I believe it is because of the degree to which D involves its wider community in improvements.
Edited for grammar.
Or rather, it doesn't provide enough to justify the downsides
- the Dlang plugin for the JetBrain suite (Clion) is quite limited and requires the dmd compiler
- the dmd compiler is not in Debian...
- for dmd you have to manually download .debs and hoping to pick a compatible version
- dub, ldc and gdc are in Debian but then don't mix & match nicely with the external dmd
I know these are all just tiny issues, but they add up...
Something else is the organization of the standard library, which is a bit confusing. Why is std.complex not in std.math? Why std.ascii, std.utf not in std.encoding? curl is in std.net, but socket is toplevel? I don't understand this organization principles.
I know I lean on Pycharm hard these days, as I don't use python as much as I used to. It really helps to guide me along and spend less time getting caught in details. Everything, including the interpreter, just works.
It's a fun language but very big. What I mean by a big language is that the syntax is very large.
Its very flexible, you can meta-program a lot in it and its easy to fall into that.
What I enjoyed the most with D was how easy it was to get started AND to prototype! Really, D could be treated as a scripting language to quickly test your ideas. And when you're ready, you can scale D into a large sized project.
I mentioned in a previous thread that the BetterC flag is a pretty cool feature that some C / C++ programmers might enjoy.
What did I not enjoy with D you might ask? The error logs or stacktrace could be too verbose and confusing, I was (and still am?) junior to writing low-level code. And last time I used D was like 4 years ago, and I remember back then when I stumbled upon issues or errors I could not figure out the cause of, it was fustrating.
Someone should write an heavily opinionated standard library like go has, with basic http,mail, dns etc support. Then D would really be a superpower
But things might have changed a lot since I used it last time.
- Much faster than Python (I use it in my day job).
- Not as flexible as Python (not much is) but its so flexible I've yet to be hindered by it.
- GC-based which has let me build complex libraries quickly without being buried in memory management.
- Large standard library with rich documentation.
- It's easy to build libraries and executables (programs are organized in directories).
- Works on macOS, Windows, and Linux.
- Supported by a plugin in IntelliJ IDEA.
- Welcoming, responsive, and active community forums.
- Write low- and high-level code in the same language.
What I don't like:
- The library ecosystem isn't as expansive as you'd find in languages like Python and C#.
- Sometimes feature additions get mired in community discussions.
I started using D after the move to D2 and only heard about the move in HN comments. Day-to-day it has never been an issue.
You can get many of the positives I list in languages like C#, F#, and Go. I think the community in D kept me from going elsewhere.
Edited for formatting.
However, the problem I have with it is lack of LTS (long term support) releases. DUB, its main package repository, has a number of decent libraries available. Sadly, each library are likely build/released on the latest version at that time. So each package can be built on different versions of the compiler. New compiler releases have been known to break something, so it is off putting to create a project in D that might, say, include a number of DUB packages.
^^ Please note that LTS has been addressed due to complaint about (another) breaking code changes from a user/poster.
This is why I have only used D for 'small projects' on my server that requires no DUB dependencies. I have tried component programming and other things but, in the end, just cannot get a handle that what I am doing really is "better" than just writing it in C. This is where I think DasBetterC peaks my interest. Of course, if you use D with no GC (which you can disable) - a lot of the features D has is no longer supported. This, to me, throws out DUB.. as it can be difficult to reason if this package is doing functional, or OOP, or whatever combination it is doing... and sometimes you might need to care about memory.
To backtrack, I have always been on the lookout for the "perfect" language... one that can be used for 97% of problems.. daemons, web, gui, etc. Personally, I just want a "Better C" language that covers these areas. It comes down to these:-
- DasBetterC - Rust - Zig - Odin
At time of writing, Odin is one I am keeping an eye on. It is not trying to cram "this cool feature" for the sake of doing so. They have set the grounds on what they will and wont do with the language. Ie No classes, not GC, no "Exception handling" etc.
I do like having the control, and yet Odin still seems enjoyable to code in - from my experience so far.- It's both fast for prototyping and also scales well for large applications.
- Compiles very fast with DMD and supports many platforms with LDC and GDC.
- CTFE (compile-time function execution) is a big win.
- standard library has enough of the common things (json, sql, csv, curl, sockets, etc.) that I need for my domain. Other stuff I can usually find a package or C library to read in if needed.
- most of the defaults seem right to me in the language versus C++ (variable initialization, struct as value type by default, explicit casting, module system, thread-local data, etc.)
Ecosystem does need a boost but I think that's actively developing, so code-d plugin for VSCode is a good place for most to start (I prefer VIM). Ecosystem seems to be slowly and steadily growing otherwise.
I can post links to more video tutorials if useful (disclaimer: I made them :) ).
Some more upcoming videos will include some tools for D's ecosystem.
I can also recommend Ali's book here as a reference to the language: http://ddili.org/ders/d.en/
But for an IOT prototype where the executable size and performance were very important we benchmarked D also along with Go and C#.NET Core.
I made the same prototype in Go, C#, Java(GraalVM Native Compile) and D-lang. The results were surprisingly positive for D-lang.
Best Peformance -> D-lang, next Go and then Java(GraalVM), C#.NET Core.
Executable Size -> D-lang:500kb, Go: 2.5 MB, C# : 11MB, Java(GraalVM):8MB.
Our major concern with D-lang was lack of dependable(tested) standard libraries.
GDC is based on GCC: https://github.com/D-Programming-GDC/gdc
DMD is stand-alone: https://github.com/dlang/dmd
If each language is used correctly, Go should come last on the benchmarks.
Last time I tried C# AOT (not sure what version, but it was in March of this year) I ended up with a 67 MB (static) executable.
Edit: the docs mention a web app at 8.5 MB (static) on Linux: https://learn.microsoft.com/en-us/aspnet/core/release-notes/...
Once you start referencing heavy dependencies like networking stack or bits of async runtime, the binary will get larger. 8.5 MB while very optimistic (it will be usually larger for back-end applications, which is different to parent comment's IoT scenario), it is actually not far off what you'd get with Rust's Tokio + Axum + Serde + Reqwest and auxiliary crates to replicate the functionality that base ASP.NET Core offers.
Regardless, < 10 MB for a nontrivial program is a huge improvement. Maybe I need to revisit C#…
The recordings are on YouTube with time stamps to each talk.
https://www.youtube.com/live/uzuKqiFVNZM?si=p4GEDK4xanGcw5rJ
These days, for system programming Rust is gaining much attention. And if you don't need such low-level control and can happily live in GC-land, probably Go/Nim suits you better.
Well, I'm not a C++ coder (mostly code in Java/Kotlin). Not sure how I'm going to use D these days...
D is what Go would have been, if its designers cared for programming language history.
Still use it occasionally on hobby projects.
What I don't like is the lack of direction, changing the next big thing that might bring people in, without fully stabilising the previous attempts.
Thus making D lose its edge over other alternatives.
If I remember correctly, for certain things rust also needs the visual C++ tools if you're on windows. You might think that installing an additional tool is a mild inconvenience, but "cant make a fully static build" is just wrong.
https://github.com/mstorsjo/llvm-mingw/releases
I would be eager to hear actual data in further replies, rather than guesses.
Apple and Google development SDKs, or any commercial OS, have similar sizes for the SDKs.
Doing Python with a C plugin, or just compiling a command line C/C++ isn't really systems programming.
I care about a minimal set of tools in order to compile C/C++ programs. thats offered by:
https://github.com/mstorsjo/llvm-mingw/releases
and also MSYS2, and even the Zig C compiler. all less than 200 MB. meanwhile Visual Studio installing about 10 GB worth. If Microsoft can offer a similar experience then I am interested.
but then i still consider java, c#, go, rust, haskell pointess badly designed and built clusterfucks, so what do i know?