Why do C++ programmers are not interested in D?

Laeeth Isharc Laeeth at laeeth.com
Wed Nov 20 01:19:32 UTC 2019


On Tuesday, 19 November 2019 at 16:24:38 UTC, Steven 
Schveighoffer wrote:
> On 11/19/19 3:51 AM, Pavel Shkadzko wrote:
>> Sorry for "clickbaity" title but I believe it is discussion 
>> inducing.
>> 
>> This spring I started looking into D and trying it for some of 
>> the data analysis and scripting tasks. So, I am fairly new to 
>> the language and all its toolset (mainly using Python and 
>> Scala at work). I don't know C++. We do however have C++ 
>> engineers so I asked them around. I was quite surprised that 
>> none of them knew or even tried to use D. They of course heard 
>> about the language but that's it.
>> 
>> This Friday I also attended a PyTorch meetup in Munich at 
>> Microsoft where one of the core PyTorch developers (Adam 
>> Paszke) made a presentation about the future of this deep 
>> learning library. During presentation he mentioned that he 
>> played around with Hasktorch (a PyTorch inspired library in 
>> Haskell) to see how does PyTorch concepts go with functional 
>> style. When I approached him after the talk and asked if he 
>> ever thought of trying D for that purpose he looked surprised 
>> and confessed that he didn't know the language, heard about it 
>> yes but it never occurred to him to try and use it.
>
> I think it pretty much has to do with
> 1. what can I get my employer to accept as a language to use and
> 2. How easy is it to interface with my existing code base.
>
> I think the complaints about the GC are way overblown, they are 
> the "Never" crowd. E.g. the ones who will never choose D for 
> whatever reason. If you fix that reason, they'll find another 
> one. Yes, I know there are certain places where the GC is no 
> good for that domain (e.g. AAA games), but there are much more 
> important problems to solve for those domains (i.e. atomics and 
> lock-free message passing), and we do give tools to prevent GC 
> usage (@nogc and betterC).
>
> But on my first point above, not many will accept D as a 
> language to base their company on. The ones who do seem to have 
> shined through with success stories (Sociomantic, Weka, 
> Symmetry), but it's just less risky to use C++ in many minds.
>
> On the second point, we need to get to a place where via tools 
> (dpp) or compiler adjustments (extern C++) we can interface 
> NATIVELY with existing C++ code. One of the most important 
> revelations from Atila, who is obviously a VERY pro-D person, 
> is when he still picked C++ for a project at the company he 
> worked for despite having sole discretion over whether to use D 
> or not. He did it because all the code was already C and to do 
> it in C++ means "I just can include the headers I need". For D, 
> he would have to port much of those headers to D by hand.
>
> We are getting there. And honestly, I'm fine with D being it's 
> own thing and not attracting huge swaths of C++ programmers. 
> They'll figure it out eventually, and there is something to not 
> chirping about how much better D is than C++ when sometimes the 
> initial experience can be so negative on your expectations 
> (stories I hear all the time from pro-D people who convinced 
> coworkers to try out D).
>
> I think we are best off not lamenting about the lack of C++ 
> immigrants.
>
> -Steve

Peter Thiel says competition is for losers.  It's a mistake to 
think that if one emerging language succeeds then another must 
fail.  Interviewing guys from a finance background they are much 
more receptive to D having done some Rust than being stuck in C# 
or python mindset.  The set of people that talk about programming 
and get the attention, that's only a particular slice of 
enterprise users and that world moves very slowly.

It's not like you hear much discussion about how D is stealing 
market share from Pascal and VBA (or even merely just from that 
functional programming language known as Excel).  But D will be 
replacing Pascal at Bastiaan's company and implicitly tools 
written in D are replacing VBA here.

I asked the boyfriend of a friend who was at Uber and Nvidia how 
they would tackle what we had done with SIL and he said too 
ambitious these days for Nvidia.  At Uber they would have put 20 
reasonably senior engineers on it.

John was talking to a reasonably senior technical guy from a bank 
at a social event.  Smart chap who could anticipate the problems 
there would be.  It was out of his reality that we could do what 
we do,that there wasn't a large team working on it or that it 
didn't take many years.

We don't even have twenty programmers across all of Symmetry 
across all projects though we do have people who don't consider 
themselves programmers but write code.  And the initial 
development of SIL was essentially one person working on it at 
any one time in the first phase.

It might be bigger now but core SIL last I checked was 5k SLoC 
versus 20k for readline.

So you can do things that are like science fiction to others if 
you don't mind making different choices and paying the price for 
it - immense social pressure, tooling challenges and the like.  
Most people shouldn't try to make that choice because their 
context isn't suitable for it.

Look at the budgets being spent on digital transformation.  I 
don't think the pool of programmers is going to stop growing just 
yet and I doubt people will become less interested in native code.

If C++ picks up more D features that's great because it's still 
C++ and a few of those who get used to things in C++ will thereby 
become a bit more receptive to using D and some will switch.

Yes c++ interop is important.  Dpp just keeps getting better and 
will handle more in time and for a zero overhead approach that or 
dstep for C is the best choice.

But, as is well known, C++ is an interpreted language that allows 
you to instantiate templates a runtime.  Okay, I am just kidding, 
but it can be true if you want it to be using cling from CERN.

It won't be that fast and for our purposes we used it in a way 
that is easy but will add more overhead.  However for lots of 
things just being able to call C++ libraries without manual work 
opens up a lot and later if it matters you can make it faster.  
So we can call quite a lot of C++ from D using cling already and 
more will follow in time.  We will open source when ready.

It's not bad to be able to use c++ libraries from our little DSL. 
  And I have a proof of concept for c# though work has stalled - 
it's not difficult though.  Python will follow too and work Atila 
is doing on autowrap PyNIH will be useful.

I think it's not really helpful to worry about what others are 
doing - honourably steal ideas, sure.  But the most important 
thing is to do good work and make the language, library and 
ecosystem better.  If that keeps happening then adoption will 
follow.

You can't force adoption to go faster than what the ecosystem is 
ready for.  Very fast growth - you know that brings other kinds 
of challenges, believe me.

If D would bring commercial benefits at work but people you work 
with can't see it, then either you will have to try putting 
personal time into demonstrating the benefits like Ali, Bastiaan 
and I did; or you will need to recognise that your workplace runs 
on different principles.  It might well be easier to get a job 
writing D than to persuade your colleagues to switch.  We are 
hiring at least twenty people and we aren't the only ones hiring 
people to write D.  So there are choices.




More information about the Digitalmars-d mailing list