Hacker News new | ask | show | jobs
by Kukumber 1224 days ago
D is a refreshing language in the sea of "alternative to C languages", they didn't reinvent the syntax, so if you come from C, using D will feel very natural and at home! (and you'll be protected from most unsafe/ub quirks of C)

When it comes to metaprogramming, it's excellent, but it is a double edged sword, it can be useful, but if abused it'll tank your build speed, so one must find a proper balance to avoid pain later

One of the few languages that offers its own backend! (LLVM/GCC backends are also available)

I love this level of independence, a real labor of love, one of the best better C, i'd even say this is the evolution C needed

1 comments

D isn't a good substitute for C due to its garbage collector.

Yes, people always chime in about how you can disable D's garbage collector, but then you're stuck with an awkward language that lacks support for basic things like exceptions, closures, strings, slices, and a host of other features not to mention pretty much any third party library.

If you are willing to accept a GC then D might be a good choice, if you find it fun then by all means go for it, but it's no longer so clear cut at that point given the wealth of GC'd programming languages available.

That's 100% bullshit

You can ignore the GC or totally suppress it with @nogc or even not even link it with -betterC flag

Having the GC optional is nice since you no longer need to use a scripting language to do your cli tools or utilities, it's there and well integrated

If you are a proper developer who care about speed and fast code, you'll want to develop your own STL anyways, just like C/C++ are already doing, just like Rust people are also doing to get faster compile speed, D gives C/C++ interop as well as full C11 compiler

So it's the perfect evolution of C, since it can compile and consume its ecosystem

You can even consume python and rust libraries, wgpu works great with D