Why is D unpopular?
Adrian Matoga
dlang.spam at matoga.info
Wed Apr 27 22:43:25 UTC 2022
On Tuesday, 2 November 2021 at 18:01:37 UTC, Ola Fosheim Grøstad
wrote:
> On Tuesday, 2 November 2021 at 17:27:25 UTC, Dr Machine Code
> wrote:
>> It got [asked on
>> reddit](https://www.reddit.com/r/d_language/comments/q74bzr/why_is_d_unpopular/) sub but for those that aren't active too, I'd like you opinions. Please don't get me wrong, I also love D, I've used it everywhere I can and I'd say it's my favourite language (yes I have one...) but I'm as as the reddit's OP, trying to understand why it's unpopular.
>
> I don't think it is reasonable to say it is unpopular, [Github
> activity shows that people create new projects with
> it](https://forum.dlang.org/thread/ltfgzovqcadknyjnabwp@forum.dlang.org) at roughly the same rate as Nim, Crystal and other smaller languages.
>
> What would be interesting to know is what made people who were
> very enthusiastic about D in the past (in the forums) switch to
> another language? Which language was it and why was that a
> better fit for them?
While I haven't been active in D community for something like
five years already, it wasn't because I switched to another PL,
but mostly due to some disturbances in personal life that made me
shift my spare time activities from programming to anything from
politics to gardening and woodworking, while still trying to
advocate for D or at least write all my single-use tools in it (I
learned that woodworkers call such stuff jigs and I sort of like
it) at work. I've recently returned to tinkering with electronics
and programming at home so let me share my view.
From my not-so-extensive professional experience, large companies
usually try to stick to well-established technologies, for two
reasons - one is to make a product fast by reusing as much as
possible from existing software, and this is mostly written in C
and C++ in the area of compilers/drivers/system-level services
(at least in Linux world) or Python and C/C++-based proprietary
GPU languages in ML, but I'm sure in other businesses there have
also been some default language choices. The other one is to sell
the product fast by not making it too weird to their customers.
Many SW engineers still think of D as a curiosity, and for their
managers and salespeople it's surely more exotic than space
travel.
So it's mostly about a killer app that makes a language an
obvious choice for thing X that one wants to work with, and I
think it's been mentioned a thousand times in this forum. You
just need to be ready and jump in as first or one of the first
into an emerging business to be successful in this race. And it's
not only about programming languages, but about any technology or
even non-technology related idea too. Python became the default
language for ML, because it was easy enough for people whose main
focus wasn't programming, and who didn't require system level
performance because available bindings to C libraries were good
enough. Guido didn't anticipate that, but somehow Python was
ready to be picked up when a need for such language emerged.
NVidia made a lot of money on ML and cryptocurrency mining not
because they entered this market when it was already mature, but
because they'd already had a mature technology (originally
designed for something completely unrelated, where they didn't
have much competition either) someone picked up for their job
that was yet to become a big business. ARM CPUs were mostly used
in various embedded systems most people don't even realize have a
computer inside, until someone picked them up for smartphones - a
product everyone on the planet desired in their pocket - and
they're still The Default Architecture for most mobile gadgets.
It seems to me that popularity or commercial success do not
exactly follow the rules of good engineering process. In my
previous job we frequently joked about the upper management that
they seemed to drive the company in an upside-down manner, sort
of - hey guys, let's make this or that solution, and when you're
done, we'll try to look for a problem that it solves. Yet
experimenting with stuff that has no immediate application is the
core of actual research, and when you try to look for a solution
to a long-existing problem, people usually have accustomed
themselves to deal with it with half-baked but then available
means, and it's extremely hard to change their habits.
What D tried to do was to be "better C++" or "better C", but in
2022 it's about 40 years too late to be successful in that.
There're millions of programs in C and C++ that have been good
enough to make revenue for many companies and thus convinced
others to invest more money, effort and time in more stuff that
depends on C and C++.
D has low chance of becoming popular in systems programming or
game programming or web programming or mobile programming or
machine learning, mostly because there had already been large
markets using other technologies in these areas long before D
tried to enter them with enthusiasts lacking huge financial
backing. It's far easier to be a pioneer in something new than to
outrun the tycoons.
Anyway, D is still my favourite language and the default language
I choose when coding something from scratch. It does have rough
edges, but it's most often less PITA than any other language I've
worked with, mostly because it's really flexible in terms of
style - it lets me solve common problems with just a bunch of
chained range calls, it lets me write clever meta stuff when I
don't want to repeat myself, it lets me get down to dirty
imperative fors and ifs and pointer hacks when I'm too lazy to
find nicer solutions. Just the right balance between typing and
thinking. I sometimes miss the rich ecosystem that Python has,
where you can find one-liners for many higher level tasks, but
quite often they're limited to some basic set of use cases and
they're not one-liners anymore when you need them to do something
beyond those. I recall I had some good experience with C# in
terms of how quickly I was able to reuse existing libraries and
implement any new code, especially with pretty convenient tooling
from MS, but that was long time ago when it wasn't seriously
usable outside Windows and I didn't have much interest in
developing for Windows later.
What I've missed the most so far in D was a zero-effort reuse of
C libraries, because there's a lot of useful libs in C I already
know. Of course it's much less tedious to interface C in D than
in Python, but I bet if D had a fully-blown ImportC from the very
beginning, it could be where C++ is today.
More information about the Digitalmars-d
mailing list