Live data from Hacker News

D Programming Language

dlang.org

211–220 of 278 posts

Re: D Programming Language

#211
post #190

Earlier quoted context omitted.

> weren't any D entries fwiw nbody.dlang 2005 https://salsa.debian.org/benchmarksgame-team/archive-alioth-... Like 20 years ago: https://web.archive.org/web/20060525101747/http://shootout.a...

Why it was removed a few years ago?

Because:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re: D Programming Language

#212

Earlier quoted context omitted.

I'm not saying D didn't have nice features - but if D/C#/Java are valid options I'm never picking D - language benefits cannot outweigh the ecosystem/support behind those two. Go picked a niche with backend plumbing and got Google backing to push it through. Meanwhile look at how popular Zig is getting 2 decades later. Why is that not D ? D also has comp-time and had it for over a decade I think ? Zig proves there's…

> D/C#/Java are valid options I'm never picking D This is perfectly fair. > D was in the perfect spot to fill if it did not make the GC decision I just find it hard to believe that the GC is the one big wart that pushed everyone away from the language. To me, the GC combined with the full power of a systems language are the killer features that made me stick to D. The language is not perfect and has bad parts too, bu…

Its not the GC, its that D has no direction. Its kitchen sink of features and the optionality just fragments the ecosystem (betterC, gc) etc, making reusing code hard.

Re: D Programming Language

#213

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+…

I used to think of D as the same category as C# and Java, but I realized that it has two important differences. (I am much more experienced with Java/JVM than C#/.Net, so this may not all apply.)

1. Very load overhead calling of native libraries. Wrapping native libraries from Java using JNI requires quite a bit of complex code, configuring the build system, and the overhead of the calls. So, most projects only use libraries written in a JVM-language -- the integration is not nearly as widespread as seen in the Python world. The Foreign Function and Memory (FFM) API is supposed to make this a lot easier and faster. We'll see if projects start to integrate native libraries more frequently. My understanding is that foreign function calls in Go are also expensive.

2. Doesn't require a VM. Java and C# require a VM. D (like Go) generate native binaries.

As such, D is a really great choice when you need to write glue code around native libraries. D makes it easy, the calls are low overhead, and there isn't much need for data marshaling and un-marshaling because the data type representations are consistent. D has lower cognitive overhead, more guardrails (which are useful when quickly prototyping code), and a faster / more convenient compile-debug loop, especially wrt to C++ templates versus D generics.

Re: D Programming Language

#214
post #32

Earlier quoted context omitted.

Not everything needs to have "traction", "excitement" or the biggest community. D is a useful, well designed programming language that many thousands of people in this vast world enjoy using, and if you enjoy it too, you can use it. Isn't that nice?

Oh a programming language certainly needs to have traction and community for it to succeed, or be a viable option for serious projects. You can code your quines in whatever you'd like, but a serious project needs existence of good tooling, good libraries, proven track record & devs that speak the language.

>Oh a programming language certainly needs to have traction and community for it to succeed, or be a viable option for serious projects.

You are totally right, sir.

>You can code your quines in whatever you'd like, but a serious project needs existence of good tooling, good libraries, proven track record & devs that speak the language.

Now, you HN user who calls yourself 4gotunameagain (which type of name is already a red flag for those in the know, because usually used by trolls), do us a favour by posting the link to at least one of your so-called serious projects here. Put your money where your mouth is.

Re: D Programming Language

#215

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.

OpenD added almost-full (you can't catch exceptions or spawn threads, so not really full, but the GC and such work fine) wasm support with like .... i think it was less than one day of work. wasm sucks though, what a miserable platform.

Why is WASM a miserable platform?

Re: D Programming Language

#216
post #107

Earlier quoted context omitted.

FIl-C, the new memory-safe C/C++ compiler actually achieved that through introducing a GC, with that in mind I'd say D was kind of a misunderstood prodigy in retrospect.

There's two classes of programs - stuff written in C for historic reasons that could have been written in higher level language but rewrite is too expensive - fill c. Stuff where you need low level - Rust/C++/Zig

Na, there are only three classes: stuff where you need simplicity, fast compilation times, portability, interoperability with legacy systems, or high-performance - C. Stuff where you need perfect memory safety: Fil-C. And stuff where you need a combination: C + formal verification. Not sure where I would Rust/C++/Zig (none of those offers perfect memory safety in practice)

Re: D Programming Language

#217
post #88

Earlier quoted context omitted.

GCC usually drops frontends if there are no maintainers around, it already happened to gcj, and I am waiting for the same to happen to gccgo any time now, as it has hardly gotten any updates since Go 1.18. The team is quite small and mostly volunteers, so there is the question how long can Walter Bright keep at it, and who will keep it going afterwards when he passes the torch.

gdc is 100% Iain Buclaw. But he and Walter collaborate on needs for gcc compatibility, as long as Iain is around, gdc will be around. It is true we have a small team. But we are a dedicated team.

> gdc is 100% Iain Buclaw

So uh, funny story: I didn’t know this a few years back. GDC was missing the sqlite interface in GDC’s phobos. This made it so the dlang onedrive client and some other packages wouldn’t compile with it. Situation was like this for years: https://forum.dlang.org/thread/doevjetmiwxovecplksr@forum.dl...

I eventually complained that it was easier to argue with Walter about politics on HN than get a library fixed on his programming language. Fortunately the right people saw it and it was fixed soon after: https://bugs.gentoo.org/722094

Re: D Programming Language

#218
post #141

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+…

Zig got too much in to avoiding "hidden behavior" that destructors and operator overloading were banned. Operator overloading is indeed a mess, but destructors are too useful. The only compromise for destructors was adding the "defer" feature. (Was there ever a corresponding "error if you don't defer" feature?)

No, defer is always optional, which makes it highly error prone.

There's errdefer, which only defers if there was an error, but presumably you meant what you wrote, and not that.

BTW, D was the first language to have defer, invented by Andrei Alexandrescu who urged Walter Bright to add it to D 2.0 ... in D it's spelled scope(exit) = defer, scope(failure) = errdefer, and scope(success) which is only run if no error.

Re: D Programming Language

#219
post #158

Earlier quoted context omitted.

There's two classes of programs - stuff written in C for historic reasons that could have been written in higher level language but rewrite is too expensive - fill c. Stuff where you need low level - Rust/C++/Zig

FillC works fine with all C code no matter how low level. There’s a small performance overhead but for almost every scenario it’s an acceptable overhead!

up to 5x is not what most people mean by small.

Re: D Programming Language

#220
post #153

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

I don't use D.. I find Nim helps with even lower ceremony. That said, it's hard for me to understand how "getting into gcc" is failure. The list of such PLangs is very short. People can be very parochial, though. They probably mean pretty shallow things (just one example, but something like "failed to convert me, personally", or "jobs I'd like to apply for", or etc.). Maybe people should instead talk about how they u…

D has named regular arguments and optional regular arguments. It has optional template arguments but not named template arguments.
Post reply on HN