Why I Like D

Paul Backus snarwin at gmail.com
Thu Jan 13 21:32:15 UTC 2022


On Wednesday, 12 January 2022 at 20:48:39 UTC, forkit wrote:
> Fear of GC is just a catch-all-phrase that serves no real 
> purpose, and provides no real insight into what programmers are 
> thinking.
>
> It's all about autonomy and self-government (on the decision of 
> whether to use GC or not, or when to use it, and when not to 
> use it.
>
> Programmers want the right of self-government, over their code.

Actually, I think *self*-government has very little to do with it.

As you correctly observe, D is a great language for programmers 
who want autonomy--far better than something like Java, Go, or 
Rust, which impose relatively strict top-down visions of how code 
ought to be written. In D, you can write C-style procedural code, 
Java-style object-oriented code, or (with a bit of effort) even 
ML-style functional code. You can use a GC, or you can avoid it. 
You can take advantage of built-in memory-safety checking, or you 
can ignore it. If what programmers care about is autonomy, it 
seems like D should be the ideal choice.

So, why do so many programmers reject D? Because there's 
something else they care about more than their own autonomy: 
other programmers' *lack* of autonomy. Or, as it's usually put, 
"the ecosystem."

If you go to crates.io and download a Rust library, you can be 
almost 100% sure that library will not use GC, because Rust 
doesn't have a GC. If you go to pkg.go.dev and download a Go 
library, you can be almost 100% sure that library *will* use GC, 
because Go *does* have a GC.

On the other hand, if you go to code.dlang.org and download a D 
library...well, who knows? Maybe it'll use the GC, and maybe it 
won't. The only way to tell is to look at that specific library's 
documentation (or its source code).

Suppose you've already decided that you don't want to use a GC, 
and you also don't want to write every part of your project from 
scratch--that is, you would like to depend on existing libraries. 
Where would you rather search for those libraries: 
code.dlang.org, or crates.io? Who would you want the authors of 
those libraries to be: self-governing, autonomous programmers, 
who are free to use GC as much or as little as they like; or 
programmers who have chosen to give up that autonomy and limit 
themselves to *never* using GC?

If you're working on a project as a solo developer, autonomy is 
great. But if you're working as part of a team, you don't want 
every team member to be fully autonomous--you want some kind of 
guidance and leadership to make sure everyone is moving in the 
same direction.

In a business setting, that leadership comes from your boss. But 
in an open-source community, there is no boss. In open source, 
the only source of leadership and guidance is *the language 
itself*. If you want to make sure other programmers in your 
community--your "team"--all agree to not use a GC, the only way 
you can do that is by choosing a language where GC isn't even an 
option.


More information about the Digitalmars-d-announce mailing list