Should I invest time in D?
Renato
renato at athaydes.com
Wed Jan 17 17:34:14 UTC 2024
On Wednesday, 17 January 2024 at 07:19:28 UTC, Lars Johansson
wrote:
> After years of procrastination, I at the end of last year
> finalized Rey Valesa's great dlang/vibe tutorial
> https://forum.dlang.org/thread/gnluupbilugncznkffuo@forum.dlang.org.
> I had planned to proceed with a deep dive into D.
>
> With the post 'Cloning D', it looks like Pandora's box has
> opened.
> I do not want to be a part of such community and the future of
> D does not look good. The alternatives do not look good either.
> Immature, boring, too restrictive etc. Is assembler the choice
> if you want to add a low level language to your Intel toolbox?
> I'm seventy one, so I do not have all the time in the world. I
> have procrastinated too long already. My humble question is
> 'Why should I use D?'. I am greatful for any polite answer:)
I've just started using D myself... so I can perhaps give a
perspective from someone coming from a similar position.
D has a lot of depth. Initially, it looked like Java with
pointers to me, but as I learned more about it, I saw a lot of
stuff I had totally not anticipated, e.g. the metaprogramming
which is just about as powerful as in Zig, though everyone acts
like Zig invented it. But to fully understand the features, just
going through the D Tour is not enough (though it's a really good
start!)... you really need to write some stuff in it and see how
it feels.
About the polemic going on in the community: I am completely
ignoring that. Every language that allows passionate people to
participate in the language development ends up with the exact
same thing. Have you seen the sh*thow going on in the Rust
community (people being invited to conferences then being
cancelled at the last minute, their Foundation trying to
copyright the use of the name Rust, some of the core developers
resigning publicly over some power play... the list goes on)?
Have you read blog posts about disgruntled developers spending
decades on Scala and then finally leaving with a big rant (it was
a running joke for a while that you must rage quit with a huge
blog post if you're a real Scala dev)?? Apparently that has
happened almost exactly the same in D (I've been reading too many
thread here lately!). This is just how developers are (perhaps
more than the general population) - they want to be heard, and if
they're not they feel like they're underappreciated, that their
genius is not being recognized and that other people are fools
for not seeing that...
Anyway, stay away from all that - it just doesn't matter when
you're working on something cool using a language you enjoy.
The things I like in D:
* at least 3 different compilers. This is more important than
people may realize!
* good, useful features.
* mature enough (though less than I expected from its 20-year
history).
* simple to use (most of the time).
* compiles fast, runs fast (though [it can be slow
too](https://forum.dlang.org/thread/bpcchllrascnjsrszheb@forum.dlang.org) if care is not taken, or super fast if you know what you're doing - see the linked thread to the end).
* @nogc, @safe, @nothrow etc. the more the compiler can verify,
the better!
Things I didn't really like much:
* package manger is good but almost completely undocumented (I
already made PRs documenting the stuff I learned - hope they'll
merge [the latest
one](https://github.com/dlang/dub-docs/pull/84)).
* not very "search" friendly due to moderate popularity so not
many questions with answers can be found.
* veteran users seem to love to complain about the language
(regardless of the politics going on). That's a bad sign... Rust
people rarely do that (except for the async debacle).
* testing is built-in (awesome!) but test reporting is terrible
(though packages do exist to make it better - but again,
difficult to find solutions).
* some constructs are very IDE-unfriendly (a downside of
CTFE/metaprogramming stuff I think, Zig has similar
"untyped"-looking - though actually typesafe - stuff).
* tooling seems subpar. VSCode is the only IDE that actually
works well and I would've preferred to use emacs or Kate (which
do work, but you have to suffer to make it usable). Tried
profiling and it was very underwhelming. Couldn't get debugging
working yet.. but didn't try very hard.
I am not sure yet I'll stick with D, but after 3 or so weeks I am
still here :D - tried Zig and Nim as well, and looked into Odin,
but those are so immature it's definitely going to be years
before they're generally usable... D is usable today. It's not
perfect for sure, but it seems to be getting better, I just hope
it doesn't get more "difficult" features and instead trims down a
bit on the complex stuff (like all the subtle differences between
pointers and `ref`, `in`, `out`, `inout`, `scope`, `const` and so
on - that kind of stuff should be much simpler IMHO).
In conclusion: if you want a good low-level, mature language that
has good tooling, I would go for Rust instead... but I don't like
the slow compilation times and millions of dependencies for
anything beyond hello world, so D is kind of a nice compromise
for me :D no offence to anyone. It's not as fast, not as
powerful... not as popular... not as safe even... but it's
simpler to use and just feels more fun without being overly yolo
like Nim, or completely raw like Zig and Odin! A good
middleground I would say.
More information about the Digitalmars-d
mailing list