January 30, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 01/30/2018 04:02 PM, H. S. Teoh wrote:
> On Tue, Jan 30, 2018 at 03:45:44PM -0500, Andrei Alexandrescu via Digitalmars-d wrote:
>> https://www.quora.com/Why-hasnt-D-started-to-replace-C++
> [...]
>
> I actually agree with all of his points, except one: C++'s "enormous
> performance advantage"?! Is he being serious? Or is his view biased by
> dmd's, erm, shall we say, "suboptimal" optimizer?
>
> Just yesterday I was experimenting with ldc while reviewing a Phobos PR,
> and it showed that LDC was well able to reduce iteration over a range
> down to a native asm loop of the same order of efficiency as an
> equivalent C++ loop. So, the cost of D (arguably better) abstractions
> simply *isn't there*. Both languages compile to the *same* native code.
> Where's C++'s "enormous performance advantage?" I'm not seeing it,
> except in this article, and, presumably, in the author's imagination.
>
> And of course, in the comments section there's the obligatory reference
> to the Tango/Phobos split in D1. Eye-roll. That one never gets old, it
> seems, even though it's already ancient history that the modern D
> community has mostly forgotten about. The internet is good for
> disseminating information, and also great for prolonging ignorance.
>
> Enough of this nonsense. Let me get back to coding... in D. :-D
At best responses would go on Quora, not here. Thanks! -- Andrei
|
January 30, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Tuesday, 30 January 2018 at 21:49:39 UTC, H. S. Teoh wrote:
> "extremely eefficient native code". I don't argue that C++ has extremely efficient native code. But so has D. So the claim that C++ has an "enormous performance advantage" over D is specious.
We also need to keep in mind that for a small segment of C++ programmers it is important to be able to use CPU/SoC/hardware vendor backed compilers so that they can ship optimized code the day a new CPU is available. So there is a distinct advantage there for people who don't aim for consumer CPUs.
Most programmers don't care as much, since adoption of new CPUs is slow enough for GCC/Clang to catch up in time.
Anyway, as C++ is taking more and more of C's niche, this issue can be more an more "threatening". E.g. hardware vendors that now only ship C compilers might in the future only ship C++ compilers... I don't know exactly where this is going, but it is possible that C++ could become hard to displace for hardware oriented programming. Seems like more an more embedded programming is moving to C++ from C.
|
January 30, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 1/30/2018 1:02 PM, H. S. Teoh wrote:
> Where's C++'s "enormous performance advantage?" I'm not seeing it,
> except in this article, and, presumably, in the author's imagination.
I know C, C++, and D code generation semantics. There is only one case where C/C++ can fundamentally generate better code than D. That's where C/C++ have undefined behavior when signed integers overflow, and slightly better code can be generated for it.
D has defined behavior for this (2's complement), and so does Rust. The performance enhancement can be obtained if you use unsigned integers instead, and besides, the advantage is very slight, and comes with a large amount of confusion for even experienced programmers. Not worth it.
|
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Tuesday, 30 January 2018 at 22:38:20 UTC, Andrei Alexandrescu wrote: >>> https://www.quora.com/Why-hasnt-D-started-to-replace-C++ >> [...] > At best responses would go on Quora, not here. Thanks! -- Andrei That's a question from 2014. I wonder if anybody would see those answers. |
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to thedeemon | On Wednesday, 31 January 2018 at 04:55:02 UTC, thedeemon wrote:
> On Tuesday, 30 January 2018 at 22:38:20 UTC, Andrei Alexandrescu wrote:
>>>> https://www.quora.com/Why-hasnt-D-started-to-replace-C++
>>> [...]
>
>> At best responses would go on Quora, not here. Thanks! -- Andrei
>
> That's a question from 2014. I wonder if anybody would see those answers.
The top 2 answers seem to have been posted in the last two weeks, and they show 14.7k and 12.8k views respectively.
|
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Tuesday, 30 January 2018 at 22:43:32 UTC, Ola Fosheim Grøstad wrote:
> On Tuesday, 30 January 2018 at 21:49:39 UTC, H. S. Teoh wrote:
>> "extremely eefficient native code". I don't argue that C++ has extremely efficient native code. But so has D. So the claim that C++ has an "enormous performance advantage" over D is specious.
>
> We also need to keep in mind that for a small segment of C++ programmers it is important to be able to use CPU/SoC/hardware vendor backed compilers so that they can ship optimized code the day a new CPU is available. So there is a distinct advantage there for people who don't aim for consumer CPUs.
>
> Most programmers don't care as much, since adoption of new CPUs is slow enough for GCC/Clang to catch up in time.
>
> Anyway, as C++ is taking more and more of C's niche, this issue can be more an more "threatening". E.g. hardware vendors that now only ship C compilers might in the future only ship C++ compilers... I don't know exactly where this is going, but it is possible that C++ could become hard to displace for hardware oriented programming. Seems like more an more embedded programming is moving to C++ from C.
BMW has a few talks from 2017 talking about them and the remaining car manufacturers finally moving away from C into C++11 (on a 2nd talk they refer C++14).
They are also taking care that car electronic standard certifications move to C++.
Sony did a similar one regarding embedded electronics.
CodePlay just started a similar work for MISRA.
So with those companies only now leaving C and moving into C++, it will take at least a decade before they consider something else.
And lets not forget Arduino, ESP286 and ESP32 are making wonders for the kids to jump into C++ as their first language.
|
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Tuesday, 30 January 2018 at 20:45:44 UTC, Andrei Alexandrescu wrote:
> https://www.quora.com/Why-hasnt-D-started-to-replace-C++
>
> Andrei
I think that the largest issue there is probably the marketing and advocacy. When Rust was about the same share as D, it had much better marketing. Someone was running their twitter channel and working to make the language much more visible. D flat out doesn't have that.
If I had to pick a second issue, it's that the ecosystem story is hard compared to other languages. New programmers aren't certain what to choose or how to get their environment up and running. Compared against Rust, Go, and Java we have horrible ecosystem fragmentation. E.g. three compilers, two separate languages for dub
|
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Attachments:
| T, Arguing things on this list serves no purpose other than to rehearse arguments. The place to say things about stuff on Quora is on Quora as Walter, Laeeth, and I have done in this case. On Tue, 2018-01-30 at 13:02 -0800, H. S. Teoh via Digitalmars-d wrote: > On Tue, Jan 30, 2018 at 03:45:44PM -0500, Andrei Alexandrescu via Digitalmars-d wrote: > > https://www.quora.com/Why-hasnt-D-started-to-replace-C++ > > [...] > > I actually agree with all of his points, except one: C++'s "enormous > performance advantage"?! Is he being serious? Or is his view biased > by > dmd's, erm, shall we say, "suboptimal" optimizer? > > Just yesterday I was experimenting with ldc while reviewing a Phobos > PR, > and it showed that LDC was well able to reduce iteration over a range > down to a native asm loop of the same order of efficiency as an > equivalent C++ loop. So, the cost of D (arguably better) > abstractions > simply *isn't there*. Both languages compile to the *same* native > code. > Where's C++'s "enormous performance advantage?" I'm not seeing it, > except in this article, and, presumably, in the author's imagination. > > And of course, in the comments section there's the obligatory > reference > to the Tango/Phobos split in D1. Eye-roll. That one never gets old, > it > seems, even though it's already ancient history that the modern D > community has mostly forgotten about. The internet is good for > disseminating information, and also great for prolonging ignorance. > > Enough of this nonsense. Let me get back to coding... in D. :-D > > > T > -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk |
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to thedeemon Attachments:
| On Wed, 2018-01-31 at 04:55 +0000, thedeemon via Digitalmars-d wrote: > On Tuesday, 30 January 2018 at 22:38:20 UTC, Andrei Alexandrescu wrote: > > > > https://www.quora.com/Why-hasnt-D-started-to-replace-C++ > > > > > > [...] > > At best responses would go on Quora, not here. Thanks! -- Andrei > > That's a question from 2014. I wonder if anybody would see those answers. But that is the problem with Quora, Stackoverflow, and all similar sites – and Google, etc. Statements and code fragments made far in the past become reified as facts hindering evolution of knowledge because Google finds them and they are on Quora, Stackoverflow, etc. It is critically important to address the questions and answers that have become wrong over time, to ensure people who search for stuff find things that are true at the time of the search. Old stuff needs flagging as old and out of date. -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk |
January 31, 2018 Re: Quora: Why hasn't D started to replace C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On Wednesday, 31 January 2018 at 06:27:05 UTC, Paulo Pinto wrote:
> And lets not forget Arduino, ESP286 and ESP32 are making wonders for the kids to jump into C++ as their first language.
That's interesting, MS got a lot of traction for BASIC by making it available in ROM on basically (no pun intended) all 8-bit computers in the 80s. To most young programmers there was no other language than BASIC (and machine language).
|
Copyright © 1999-2021 by the D Language Foundation