Live data from Hacker News

D Programming Language

dlang.org

191–200 of 278 posts

Re: D Programming Language

#191
post #145

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

> GC/runtime 1. Runtime: A runtime is any code that is not a direct result of compiling the program's code (i.e. it is used across different programs) that is linked, either statically or dynamically, into the executable. I remember that when I learnt C in the eighties, the book said that C isn't just a language but a rich runtime. Rust also has a rich runtime. It's true that you can write Rust in a mode without a ru…

It's pretty obvious from the context that runtime/GC means having a runtime with a tracing GC - and the tradeoffs are well known. These discussions were played out over the last two decades - we all know GC can be fast, but there were and are plenty of use-cases where the tradeoffs are so bad that it's a non-starter.

Not to mention that writing a high quality GC is a monumental task - it took those decades for C# and Java to get decent - very few projects have the kind of backing to pull that off successfully.

In practical terms think about the complexity of enabling WASM that someone mentioned in this thread when you reuse C runtime and skip tracing GC.

I'm kind of venting in the thread to be fair, Walter Bright owes me nothing and it's his project, I had fun playing with it. I'm just sad we couldn't have gotten to Zig 20 years ago when we were that close :)

Re: D Programming Language

#192

Earlier quoted context omitted.

> I always dread dealing with python developers though tbh. Out of curiosity, why is that?

There are plenty of brilliant people who use python. However, in every one of these boom cycles with python I dealt with A LOT of developers with horrific software engineering practices, little understanding of how their applications and dependencies work, and just plane bizarre ideas of how services work. Like the one who comes with 1 8k line run.py with like 3 functions asking to “deploy it as a service”, expecting…

Thanks for the detailed reply. I wrote and deployed a few dev-opsy python scripts in my last job that I wasn't massively proud of, but after reading that I all of a sudden don't feel so bad lol

Re: D Programming Language

#193
post #145

Earlier quoted context omitted.

> GC/runtime 1. Runtime: A runtime is any code that is not a direct result of compiling the program's code (i.e. it is used across different programs) that is linked, either statically or dynamically, into the executable. I remember that when I learnt C in the eighties, the book said that C isn't just a language but a rich runtime. Rust also has a rich runtime. It's true that you can write Rust in a mode without a ru…

The "GC is slow"/"JIT/VM's are slow" is such a tired, dated take at this point. Look at C#'s competitive placings with C++/Rust on The Computer Benchmark game due to .NET's ruthless optimization.

Ironically those optimizations came from .NET avoiding GC and introducing primitives to avoid it better.

And .NET is moving heavily into the AoT/pre-compilation direction for optimization reasons as well (source generators, AoT).

If you look at the change logs for the past few versions of the framework from perf perspective the most significant moves are : introduce new primitives to avoid allocating, move more logic to compile time, make AoT better and work with more frameworks.

Re: D Programming Language

#194
post #172

Earlier quoted context omitted.

Sociomantic (bought by Dunhumby, now defunct IIRC) had a realtime advertisement business built in D. Weka have a realtime distributed filesystem written in D, used for ML/HPC workloads.

> Weka have a realtime distributed filesystem written in D, used for ML/HPC workloads. This https://github.com/weka ? Most of the D repositories appear to have very little activity. The Go repositories seem to have more activity.

That's the public stuff.

An example of Weka talking about how they use D (there are more examples at this and other dconf presentations): https://www.youtube.com/live/Ou4KUBjr_78?si=bPOs-19gPemQe_ap...

Re: D Programming Language

#195
post #182

Earlier quoted context omitted.

No, you can just write D. It'll have the same performance as C, if you write C-like code. It might have better performance than C if you use templates (just like in C++).

But why then did arcadia_leak imply as far as I understood him that C is needed for performance in D? But D is not included in the benchmarks game at debian.net, which isn't fair to D either as far as I can tell.

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

Re: D Programming Language

#196
post #85

Earlier quoted context omitted.

> Are there technical reasons that Rust took off and D didn't? As someone who considered it back then when it actually stood a chance to become the next big thing, from what I remember, the whole ecosystem was just too confusing and simply didn't look stable and reliable enough to build upon long-term. A few examples: * The compiler situation: The official compiler was not yet FOSS and other compilers were not availa…

Can you elaborate on the points? I know nothing about D, but I'm just curious about old drama

ooooold drama. Like 2008.

FOSS: DMD was always open source, but the backend license was not compatible with FOSS until about 2017. D is now officially part of GCC (as of v6 I think?), and even the frontend for D in gcc is written in D (and actively maintained).

D1 vs. D2: D2 introduced immutability and vastly superior metaprogramming system. But had incompatibilities with D1. Companies like sociomantic that standardized on D1 were left with a hard problem to solve.

Tango vs phobos: This was a case of an alternative standard library with an alternative runtime. Programs that wanted to use tango and phobos-based libraries could not. This is what prompted druntime, which is tango's runtime split out and made compatible, adopted by D2. Unforutuntately, tango took a long time to port to D2 and the maintainers went elsewhere.

gc vs. nogc: The language sometimes adds calls to the gc without obvious invokations of it (e.g. allocating a closure or setting the length of an array). You can write code with @nogc as a function attribute, and it will ban all uses of the gc, even compiler-generated ones. This severely limits the runtime features you can use, so it makes the language a lot more difficult to work with. But some people insist on it because it helps avoid any GC pauses when you can't take it. There are those who think the whole std lib should be nogc, to maximize utility, but we are not going in that direction.

Re: D Programming Language

#197

Earlier quoted context omitted.

One feature of D that i really wish other languages would adopt (not sure about Rust but i also think it lacks it, though if it has it to a similar extent as D it might be the reason i check it again more seriously) is the metaprogramming and compile-time code evaluation features it has (IIRC you can use most of the language during compile time as it runs in a bytecode VM), down to even having functions that generate…

Arguably, most of the metaprogramming in D is done with templates and it comes with all the flaws of templates in C++. The error messages are long and it's hard to decipher what exactly went wrong (static asserts help a lot for this, when they actually exist). IDE support is non-existent after a certain point because IDE can't reason about code that doesn't exist yet. And code gets less self-documenting because it's…

No, templates are only needed to introduce new symbols. And D templates are vastly superior to C++. D's superpowers are CTFE, static if, and static foreach.

auto is used as a return type because it's easy, and in some cases because the type is defined internally in the function and can't be named.

You would not like the code that uses auto everywhere if you had to type everything out, think range wrappers that are 5 levels deep.

Re: D Programming Language

#198

Earlier quoted context omitted.

My (likely unfair) impression of D is that it feels a bit rudderless: It is trying to be too many things to too many people, and as a consequence it doesn't really stand out compared to the languages that commit to a paradigm. Do you want GC? Great! Do not want GC? Well, you can turn it off, and lose access to most things. Do you want a borrow-checker? Great, D does that as well, though less wholeheartedly than Rust.…

> and lose access to most things What "most things" are these?

In addition to what chainingsolid mentioned, I believe that you lose access to most of the standard library. But I don't have actual numbers on that

Re: D Programming Language

#199
post #88
post #76

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

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.

Re: D Programming Language

#200

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.

You'd be surprised to see how active the D community is, despite your fair point that it's noticeably smaller than in the "competing" (in quotes because it's not a competition, actually) languages. The latest release [1] was on Jan 7th, and it contains more updates than, say, the latest release of Dart, which has one of the largest corporations behind it. 1. https://dlang.org/changelog/2.112.0.html

To be fair, the release cadence has been in a bit of a mess lately. But I expect that to be fixed soon. We don't want 6 months between releases.
Post reply on HN