The conversation

Lessons learnedExperience excerpt · English

One question: I tried to use D several times in my career (20 years of C++ experience here, roughly)

… One question: I tried to use D several times in my career (20 years of C++ experience here, roughly). I found it a lot of fun. I like it better than more "modern languages". I like the plasticity D provides. But I am not sure how it would work if I want to do: 1. backend (server-side mainly, Linux is main platform, x86-64) 2. desktop + android and iOS (being mobile more important than desktop) 3. web assembly (even more important than mobile at this moment, could change). 4. backwards compatibility (heard complaints of versions breaking stuff frequently around). 5. interaction with C++. I do like D a lot, but the problems I had before were more related to tooling (autocomplete, I use mainly Emacs but did not try for a few years) and toolchain maturity. It would be ready for all of the above? Also, very very handy would be to wrap C++ code and C code. I saw that D had an ongoing effort for C++ compatibility better than other languages, but I am afraid it could be half-broken. Even if it is, it is documented what works and what does not work? That would help a lot. Thanks.

Original discussionDConf 2026 in London70 source comments · at import
2

What was this responding to?

Parent context · original excerpt

WA

> I would classify D's scope exit/failure/success as RAII actually, even if D uses a GC. D's scope exit/failure/success is built on top of RAII and has nothing to do with the GC. > I would say exceptions should be the main mechanism in normal circumstances and for expected errors you csn use error/result types. Come to DConf (or watch the live stream) and I hope I can change your mind, or at least challenge your conclusions!

Full original

Community replies 0

No community replies yet. Add your perspective.

Replies from the source 2

Direct replies available in this import. Original-language excerpts.

WA

> D does not use destructors (like C++) for scope exit/failure/success It does, but the user doesn't see them. There are people working on 1, 2 and 3. > 4. backwards compatibility (heard complaints of versions breaking stuff frequently around). We listened, and cut way back on breaking changes. Now we have editions. > 5. interaction with C++. C++ has gotten to the point where it would take another decade of my time to wire in ImportC++. However, if you stick with C++'s C interface when interfacing with D, you should be fine. D will also work with C++ name mangling, but all the complexity of C++ templates and such is just too much. And thank you for the kind words! I definitely appreciate it. > I am far and cannot attend, so I will definitely watch it. Wonderful!

Full original
SK

Regarding web assembly, support is limited. There's been several efforts to support WebAssembly in D but they were one man efforts that never got finished and merged to the mainline D. The only support there is in the official D compiler is for the BetterC mode, which is a minimal mode with no garbage collection, no runtime and effectively no standard library. There's been some people doing some interesting projects in it but you have to reimplement a lot of basic stuff such as data structures just to get going and at that point you might wonder why not just use C/C++ instead. There is a fork of D compiler called OpenD which has some WebAssembly support with garbage collection and standard library. I've used it, it works for the most part, but there's bugs and if you encounter any issues then you're on your own.

Full original
Continue on Hacker News

Respect different perspectives. Share concrete experiences.

Sign in to post, reply, repost, and quote.