It is the year 2020: why should I use / learn D?

Laeeth Isharc laeeth at kaleidic.io
Thu Nov 22 04:07:32 UTC 2018


On Wednesday, 21 November 2018 at 14:38:07 UTC, Chris wrote:
> 
> I watched the whole keynote. Well, to begin with it's still a 
> very young language (not 18+ years old) and keeps getting 
> better and better. Things that were a bit tricky just recently 
> are now much easier and part and parcel of the language. It 
> shows that they listen to their user base and make things as 
> easy as possible. In many ways it's already miles ahead of D in 
> terms of what you need as a programmer to get things done fast, 
> e.g. tooling, interop, multi-platform, handling of deprecations 
> etc. There are useful features (I already knew from D) that 
> make life easier (e.g. lambdas).

Life isn't a zero-sum competition.  It's good for D if other 
emerging languages flourish.  Its bad for D if people worry about 
what others might be doing rather than thinking about how to make 
D the best language it can be.


> And as for meta-programming (I knew this would come up ;)), I 
> don't really miss it / use it anymore. There was only one case 
> where I said it would have been nice, but it wasn't _really_ 
> necessary (it was just an old D habit, really). In fact, 
> meta-programming in D can cause a lot of unnecessary headaches 
> (cryptic compiler warnings galore, code breakage) and stall the 
> whole development process unnecessarily - and often for very 
> little extra value. It says a lot that Adam D. Ruppe stated 
> that if you don't want your code to break, use non-idiomatic D. 
> So what's the point of it then? It's just absurd.

Maybe D isn't the right language for you if you feel it doesn't 
bring anything special.  That's okay - it's a big wide world with 
plenty of room for there being different ways to be successful.

Everything has a cost to it.  Sometimes it's not worth the 
benefit.  But the dollar value of those things very much depends 
on your context and what you are trying to achieve.  One doesn't 
need to use metaprogramming if one doesn't want to, after all.  
My own experience is that it has been quite useful.

> D could have been a real contender here (e.g. C interop) but 
> instead of investing in a good infrastructure / tooling, 
> cleaning up and stabilizing the language,

You know Mrs Thatcher once said there is no such thing as 
society, only individual men and women and families.  That's an 
overstatement - it's not one or the other, but society doesn't 
act as some mysterious social organism.  And it's the same with 
community.

Ive been investing a bit in tooling.  Dpp is pretty convenient 
for using C libraries and dstep also has improved by leaps and 
bounds.  Dpp has already saved me an incredible amount of time 
personally and it's made it possible to explore more options.  
It's Atila's personal project that I sponsor in a modest way.

I open sourced a wrapper to create excel workbooks in D.  Also a 
D wrapper for reliable UDP - UDT.  It sped up file transfers 
between London and HK by between 100x and 350x.

Then there is autowrap, which was developed for in house use but 
I open sourced.  It now couldn't be easier to write D libraries 
for python, or excel addins and quite soon (it's there but the PR 
is undergoing code review in the open) for C# too.  Next project 
after that will be the other way around for C# so you can easily 
use C# code from D with no fuss once it's finished.

Manu has been working on including STL in D runtime.

And by the way I think dpp isn't so very far from being able to 
#include vector and more of C++ will follow in time.  So no idea 
when but in time there's a decent chance you can #include cpp 
libraries and find it just works in many cases and in others it's 
minimal work.

Based on a suggestion from Dmitry Olshansky I was playing around 
with graal vm. Polyglot.h just works with dpp.  Some work to 
write a wrapper but you can easily compile D to Llvm bitcode and 
have it run on the JVM where the tracing jit will do its magic 
and you can quite easily talk to js, java, python, R via 
polyglot. If I make any progress with the wrapper I will open 
source it.

I give a little money to the D Foundation and it will increase in 
time.  Symmetry sponsored the first Symmetry Autumn of Code with 
a couple of quite ambitious projects - fork GC and http 2.

You're part of the D community I think.  What have you been 
contributing? I presume something, because otherwise why so 
frustrated that other people are not doing what you would like 
them to.

the community has
> turned D into a "feature laboratory" where ideas are discussed 
> to death and really important issues are swept under the rug.

People say a lot of things on forums.  I think that's why lots of 
people don't bother and spend more time discussing pull requests. 
  Talk is cheap. Personally, I've not been unhappy with the 
direction things have moved in over the past few years.  Do you 
really not recall what things were like in 2014?

> Other new languages focus on tooling and interop from the very 
> beginning as they realize that this is very important these 
> days, more so than fancy features (that can be added later).

Its based around voluntary cooperation.  How do you propose to 
make people work on things they personally aren't interested in 
doing?

If IDEs are that important to you, it might not be the right 
choice - I don't know.  I have the impression things keep getting 
better there but I personally don't use an IDE so I wouldn't 
know.  People I work with don't seem miserable about VS support.  
It's not one of the things I have heard anyone grumble about.

If they are important to you, what steps did you personally take 
to move the world just a little in the direction you wish it to 
go?  I'm presuming you did something otherwise its funny to 
grumble.

What more would you reasonably like others (for example me) to do 
on interop?  (the big thing is the improvement in cpp interop, 
especially mangling).  It also does not seem to me like theres a 
dramatic amount to do - cpp will get there in time.  C is easy.  
Python and Excel are done.  C# libraries in D is done first draft 
and the reverse will follow.  Jni isn't hard and polyglot is even 
easier and maybe will be made as easy as anything can be in time. 
  Honestly, what's missing?  Nodejs?! Julia? (at least Julia.h 
just works with dpp)

> Then, of course, the inevitable "X doesn't have feature Y, but 
> D does! That's why X sucks." Only: are all these super features 
> indispensable for production?

I am surprised you think the benefit of D is a matter of ticking 
of features.  I was just explaining to a colleague who was 
intrigued enough to take Andrei's book home that truly D brings 
nothing new, if you look at it from a tick box point of view.  
Don't even bother trying if you're going to think of it that way.

But actually D does bring something quite unique and whilst it 
may not exactly be Christopher Alexander's quality without a 
name, it does relate to that.  In his paper on harmony - seeking 
computations (which is what characterizes life, a contrast with 
the deadness of mere emergence) he discusses a little experiment 
in which he shows the learnt inability of his Radcliffe students 
to notice patterns that really did exist but required a gestalt 
conception and couldn't be appreciated from considering the parts.

So it's my personal view that if D brings something valuable, you 
really shouldn't expect it to be a matter of this feature or 
that. It's what it's like working on a project over time in D and 
what it's like brings pretty valuable commercial benefits. I 
speak of my own experience but what I have heard from Liran at 
Weka is consonant with that.

Plasticity is something pretty valuable if you are in a business 
where intrinsically requirements evolve and can in any case never 
be sufficiently fully understood upfront.  Readability and 
expressiveness too.  That the deeper conceptual understanding of 
what plasticity is has yet to be understood does not mean its not 
something very real and important.  I think it has to do with 
certain ideas from Christopher Alexander, Goethe and others, but 
I'm still figuring that out.

> why hasn't D got backing from big players yet?

Because it's solving different problems from the ones they have.  
Since at least in the US more than 100% of jobs are created by 
small and medium sized businesses, and since big tech have plenty 
of choices that solve their problems, then my personal view is 
that its a wonderful thing that D isn't backed by big tech.  I'm 
not even talking about potential impact on funding if the end of 
the bubble in despair weighs on the sector that people could 
believe in amidst despair and we see a rotation of capital into 
other sectors something that could weigh on funding generally.


  Because of the community's elitist and parochial
> mindset and the overall lack of consistency.

What did you personally do to make things less parochial and more 
consistent?

And btw parochial??  My own experience hiring D programmers from 
the community (two of them I met at the first meetup I went to) 
has been that one of the biggest benefits has been an opening up 
of the group to different ideas.  There are so many more varied 
and different discussions today than before.  That's a 
consequence of hiring people from the D community.

If by the community you meant people who post on the forum then 
you are making an identification error.  They are by no means the 
same thing.

> Joakim, you have done some great work as regards Android / iOS
Indeed.

> and I believe we are on the same page here. But see that the D 
> Foundation didn't pick up on it and say "Let's take this and 
> create some sound tooling for ARM cross-compilation."

You remind me of conversations with senior guy from an investment 
bank being on the hedge fund side.  You should do this or do 
that.  Well maybe, but how do you think I ought to make it happen 
in the context I am in.  Its a small company with only 140 odd 
people.  How is one to execute because a grand strategic plan by 
itself won't change a thing.


You seem to be assuming the D Foundation has not just a gazillion 
dollars but a big staff to go with it.  This isn't the case, I 
think.  It wasn't set up long ago and it's just beginning to 
start to get going.  It's awfully hard creating something from 
nothing (and it takes ages before you see results since it's an S 
curve) though of course its easy to give helpful advice.

But talk is cheap and it really doesn't change much.

If you would like to change the world, you know it's really up to 
you.  It's pretty easy to make an impact.  But to my eyes it's 
reminiscent of the behaviour of a spoilt child to insist others 
do things unless they are also doing what they can given their 
situation to help.

Are you?

And by the way my personal experience is that the small 
contributions I have made or that have been made commercially 
have been some of the highest return investments for me of the 
past decade.  Yet I was never really thinking too much about the 
roi, just making sure if I spent a modest amount of someone 
else's money I was acting as a good steward of it.

It's a stunning arbitrage to contribute to the community from 
where I sit.  That won't be true of everyone because the context 
is different.  But it might be true of more people than realise.



More information about the Digitalmars-d mailing list