logoalt Hacker News

D Programming Language

167 pointsby arcadia_leaktoday at 5:18 AM197 commentsview on HN

Comments

rafaelmntoday at 9:54 AM

IMHO D just missed the mark with the GC in core. It was released in a time where a replacement for C++ was sorely needed, and it tried to position itself as that (obvious from the name).

But by including the GC/runtime it went into a category with C# and Java which are much better options if you're fine with shipping a runtime and GC. Eventually Go showed up to crowd out this space even further.

Meanwhile in the C/C++ replacement camp there was nothing credible until Rust showed up, and nowadays I think Zig is what D wanted to be with more momentum behind it.

Still kind of salty about the directions they took because we could have had a viable C++ alternative way earlier - I remember getting excited about the language a lifetime ago :D

show 3 replies
jakkostoday at 7:51 AM

I often see people lament the lack of popularity for D in comparison to Rust. I've always been curios about D as I like a lot of what Rust does, but never found the time to deep dive and would appreciate someone whetting my appetite.

Are there technical reasons that Rust took off and D didn't?

What are some advantages of D over Rust (and vice versa)?

show 7 replies
Rounintoday at 8:50 AM

As far as adoption is concerned, I'm not sure it should be that big of a concern.

After all, D is supported by GCC and Clang and continually being maintained, and if updates stopped coming at some point in the future, anyone who knew a bit of C / Java / insert language here could easily port it to their language of choice.

Meanwhile, its syntax is more expressive than many other compiled languages, the library is feature-rich and fairly tidy, and for me it's been a joy to use.

show 2 replies
skocznymrocznytoday at 9:04 AM

I like D in general, however it is missing out in WASM where other languages like Rust, Zig, even Go are thriving. Official reasoning usually included waiting for GC support from WASM runtime, but other GC languages seem to just ship their own GC and move on.

bingemakertoday at 7:42 AM

Off topic: Back in the day, C++ programming books Andrei Alexandrescu are a joy to read, especially, Modern C++ design.

Also, this presentation https://accu.org/conf-docs/PDFs_2007/Alexandrescu-Choose_You... killed a lot of bike shedding!

erzhan89today at 8:09 AM

When I was student, our group was forced to use D lang instead C++ for CS2* classes. That was back in 2009. After 16 years I see that level of adoption did not change at all.

ivolimmentoday at 11:57 AM

I tried some D some time ago, it is a nice language. Given today's landscape of programming languages I think it's difficult to reason why a program should be written in D if there are more programming languages that overlap in features. Also depends on how fast you need to scale in developers, how quickly people can learn a language (and not just the syntax) so popularity is also important. I work in consultancy and this is what I always factor in for a client.

999900000999today at 9:31 AM

What can D do other languages can't?

Say your starting a new Staff Engineer or Tech Lead job. What gets you to convince a CTO that we need to have a team learn D ?

On the flip side, where are the 200k base salary D positions.

Get me an interview in 2 months and I'll drop 10 hours a week into learning

show 1 reply
kombinetoday at 7:44 AM

I was personally a lot more excited by D and subsequently Nim, but ultimately it's Rust and Zig that got adoption. Sigh.

dhruv3006today at 8:16 AM

I remember the creator of D programming Language replying to me on HN on one of my posts!

https://news.ycombinator.com/item?id=46261452

show 2 replies
WhereIsTheTruthtoday at 8:47 AM

D is a treasure we should continue to cherish and protect

A language with sane Compile Time features (Type Introspection, CTFE, mixins, etc)

A language that can embrace C ecosystem with sane diagnostics

A language that ships with its own optimizing code generator and inline assembler!

A compiler that compiles code VERY fast

A compiler with a readable source code that bootstraps itself in just 5 seconds

People who dunk on it "bEcAuSe iT Is nOt MaInsTrEaM" are clueless

cocodilltoday at 10:16 AM

D is boring, let's see how to recreate the B language:

https://www.youtube.com/playlist?list=PLpM-Dvs8t0VZn81xEz6Ng...

ameliustoday at 10:04 AM

How good are the big LLMs at writing D code? Just curious.

small_modeltoday at 10:23 AM

Seen D being posted regularly on here, seems like flogging a dead horse. It's the equivalent of keeping grandma on life support when there is no hope.

show 1 reply
self_awarenesstoday at 7:52 AM

I never understood why this language didn't gain much traction. It seems very solid.

At the same time, I've never used it, I'm not sure why.

Anyway, the author of D language is here on HN (Walter Bright).

KnuthIsGodtoday at 5:34 AM

Sigh.

Ownership and borrowing are so much less baroque in D than in Rust. And compile times are superb.

In a better world, we would all be using D instead of C, C++ or Rust.

However in this age of Kali...

show 4 replies
casey2today at 11:56 AM

When design a language for everything nobody will use it for anything. When you design a language to simply accomplish one thing people will use it for everything. This is because people get the most efficient training using that simple language for one thing. From there it is only marginally more effort to carry some boilerplate.

That "one thing" could be real or propaganda. Rust's one thing is writing "memory-safe" without GC. Eventually the marginal cost becomes too high or your are tricked by advertising and "graduate" from awk to perl. From there depending on the pull of the community or the actual utility of the language you will use it for more and more tasks. If the community pull is strong your programs start to look like line noise or boilerplate hell. If the utility for your problems is genuine they remain simple but you probably aren't producing the most efficient binaries.

As for why c programmers don't just use -betterc well some do, but for most people the reality is that can just do it in c and prefer c -> c++ (ofc the vast majority of projects just start as c++ which makes -betterC )

c++'s one thing c with objects.

If you learned to code writing Go what did you do?

If you learned to code writing D what did you do?

That's not to say you can't learn to code from writing D just that it discipline, most people don't even know a problem exists before they are already learning some language or tool, nor do they have the goal of building everything, most programmers are lazy they want to build the minimal amount and end up building everything by accident.

Why don't experienced devs use D then? They think if they strive for ideological purity that they won't "build everything" next time, or they just enjoy ideological purity as it's own mental exercises. Unix faithfuls want to show that computing can be (conceptually) simple in implementation and use. Rust programmers want to show that those simple (to use) unix programs can be (memory) safe. To a senior engineer D is just too good and easy to take.

DeathArrowtoday at 11:21 AM

Every talk about D here seems to transform into "why D failed?".

show 2 replies
lossolotoday at 10:49 AM

Years ago I got interested in D. It's a great language, but at the time its garbage collector was leaky. There weren't any D entries on the Benchmarks Game back then, so I ported most of the programs to D and optimized them as best I could as a newcomer. Performance wise, D was in the C/Rust/C++ range and in many cases it even beat Rust and C++. I tried to get the community involved to help the language gain wider adoption, but nothing really happened. I think everything has its moment, and D's moment has passed. They didn't make the most of the window when D could have gone mainstream.

show 1 reply
reeddev42today at 12:07 PM

[dead]

that_guy_iaintoday at 6:22 AM

Serious question, how is this on the front page? We all know of the language and chosen not to use it.

Edit: Instead of downvoting, just answer the question if you've upvoted it. But I'm guessing it's the same sock accounts that upvoted it.

show 7 replies
4gotunameagaintoday at 6:38 AM

D is like a forced meme at that point.

Never has an old language gained traction, its all about the initial network effects created by excitement.

No matter how much better it is from C now, C is slowly losing traction and its potential replacements already have up and running communities (Rust, zig etc)

show 4 replies
qualitylearingtoday at 9:17 AM

Oohh, riiiighttt, D is new(s).

Slow day?