November 16, 2018
On Wednesday, 14 November 2018 at 15:07:46 UTC, lagfra wrote:
> https://www.reddit.com/r/cpp/comments/9vwvbz/2018_san_diego_iso_c_committee_trip_report_ranges/
>
> By 2020 C++ is planning to introduce:
>
> * Ranges
> * Contracts
> * Concepts (`__traits`)
> * Proper constexpr
> * Modules
> * Reflections
> * Green threads
>
> Right now it already has:
>
> * `auto` variables
> * Ranged for (`foreach`)
> * Lambda expressions and closures
> * `nothrow` attributes
> * Proper containers
> * Proper RAII
>
> In no way this is the usual trollpost (I am a participant of SAoC). What bugs me is the shortening distance regarding what D has to offer with respect to C++. While D for sure has a way better syntax (thinking of template declarations, `immutable`, UDAs) and a GC, what are the advantages of using D vs C++ if my goal is to build a complex system / product?
>
> TL;DR: what will D offer with respect to C++ when almost all key features of D are present in C++20(+)?

Because C++ still have terrible support for proper web development. This is a joke, but not really. There is nothing in C++ that's equivalent to anything currently available in D when it comes to web development. D is pretty close to what other popular languages can do such as Django (Python), ASP.NET (C# / .NET), Rails (Ruby), Node (JS) etc. C++ doesn't really have anything that's at an equivalent level. The closest thing is probably something like CppCMS, but not only is it old, it's also way behind some of the D frameworks :)

Also D will still have a much more beautiful syntax, C++ is never going away from the "ugly" syntax it has.

Templates will always be superior in D.

CTFE will still be superior to constexpr in C++, because D doesn't really have a difference between a runtime function and a compiletime function. I reckon that C++ will be much more limited.

There are a lot more than just language features that makes D a better choice than C++ in my opinion.

Also when C++ announces what they plan to implement for a version, usually half of the things doesn't make it and are usually brought up in the next version again, where they may or may not make it.

An example is modules in C++, it was planned for C++17 too as far as I remember.
November 16, 2018
On Friday, 16 November 2018 at 03:50:55 UTC, Aurélien Plazzotta wrote:
> On Friday, 16 November 2018 at 02:02:26 UTC, H. S. Teoh wrote:
>>
>> Talking about D3 has sorta become taboo around here, for understandable reasons -- splitting the community now might very well be the death of D after that Tango vs. Phobos fiasco.
>>  Python survived such a transition, and Perl too AIUI.  But D currently does not have nearly the size of Python or Perl to be able to bear the brunt of such a drastic change.
>>
>> Nevertheless I can't help wondering if it would be beneficial to one day sit down and sketch out D3, even if we never actually implement it. It may give us some insights on the language design we should strive to reach, based on the experience we have accumulated thus far. Autodecoding, even though it's a commonly mentioned example, actually is only a minor point as far as language design is concerned.  More fundamental issues could be how to address the can of worms that 'shared' has become, for example, or what the type system might look like if we were to shed the vestiges of C integer promotion rules.
>>
>>
>> T
>
> I can't help but think D3 is the one true way to go to become significantly adopted by more companies.

Maybe it would be a good thing, but I think it's maturity of compilers, ecosystem and tooling that's the biggest obstacle for adoption - and perceptions are lagging and where we are today is a consequence of decisions taken some time back.  Start to improve things and it's a while before you see results and longer again before people notice.

> Maybe ten companies are using D for minor projects, it doesn't justify to stall or slow down the whole language specs.

Come on - there are quite significant entire companies where D is critical and others where it is used for important projects.

Starting again from scratch may or may not be a good idea, but it won't exactly help with maturity or for many adoption.  "I think I will wait till D3 is ready".

I don't know but any fixing of past mistakes seems to me a much smaller change than D1 to D2 and so I don't know if it is the ideal framing.  It's more like D 2.1 although then the versioning of releases gets a bit confusing.


> The language is still in a phase where it can allow himself breaking changes to significantly improve its performances or reduce the frictions and asymetries.

Sure.


> However, I wouldn't gamble a penny on D3 for more practical reasons.
> The creators and the main contributors of D are all C++ full-time developers

?  I don't think so.  Walter is a full-time developer of the D language and he has just put a lot of work into moving both dmd and DMC from C++ to D.  Andrei quit Facebook to work full-time on the D Foundation.  Maybe they do some other consulting on the side.  If you were CEO of D and they worked for you, you would want them to do this because it's good for the language that they do.

Other contributors do all kinds of different things.  I work with a decent number of them and mostly they work on D projects full-time.

>  some of them even members of C++ commities.

Traitors!  We must hunt them down and expel them!  Seriously,how can this be a bad thing?  Some people are even members of non-native code communities also!  Why wouldn't we want to have the benefit of the idea interchange that results ?

> For example, Walter distribute and commercialize a C++ compiler
That's his old gig and he keeps something going I guess, but it doesn't look to me like he is putting much time into DMC.  When is the Cpp 2017 version coming out?  My guess is never.

 > And Andrei contribute to C++ meeting in order to
> identify and improve the weaknesses of C++...

And they often don't listen and mess it up when they do, just like with static if.  How is this a bad thing?  If C++ gets better,I really don't think it's bad for D.

> No offense, but I don't think anyone important here believe in D becoming a industry-proof language in any timeline.

Each must think what they will and I never worried much myself about who is important but rather who is doing good and interesting work.  Of those people some seem to be doing remarkably well using D.  I guess they aren't themselves bothered whether you consider them important either!

 In my
> opinion and with due respect, I am convinced that D is more or less processed like a research laboratory to test and implement new features to then improve C++ specs and its standard librairies.

Interesting opinion.  I personally disagree - seems clearly wrong to me and some here might say "if only!  Would that it were true!"

> D cannot grow and develop its own identity if the main focus is C/C++ compatibility.

Do you really think that's the case that it's the main focus?

> Make no mistake, nobody will abandon his job in C++ among the D community to persuade a employer to hire him for a D full-time job

:)

There are no jobs in D :)

I'm pretty sure you are mistaken both on the supply and demand side.

And we are still hiring.

> I wish I haven't hurt anyone's feelings but D project lack a bit of long-term vision.

I think right now the vision is clear enough as far as it needs to be articulated and the biggest constraint is that the D Foundation hasn't been in existence for long and it's quite a lot of work to create something from nothing and it takes time from beginning to start to see results though if one pays attention I don't think it's hard to see plenty of results already.

Everything is an S curve - very flat in the beginning.

November 16, 2018
On Friday, 16 November 2018 at 07:14:26 UTC, NoMoreBugs wrote:
> On Friday, 16 November 2018 at 06:51:56 UTC, aliak wrote:
>>
>> Actually Eric Niebler did mention in his (i think it was a keynote) in cppcon 2015 that a lot of the work was done by the D community :)...  Or "thanks to the D community" or something along those line.
>
> lets be more precise shall we ;-)
>
> (on bottom of slide) 'The idea for this talk was taken from the article "Component programming with ranges" on the D language wiki.'
>
> Then a few seconds later, says that it was 'stolen from the D community'.

As a member of the D community 'stolen from the D  community' is fine by me,
it's their fault they didn't steal it properly ;)
November 16, 2018
On Wednesday, 14 November 2018 at 19:39:42 UTC, Laeeth Isharc wrote:

> DPP already helps I think.  As does dstep.  Don't forget also the work to get STL types into druntime.
>
Do any of you have any information regarding the STL types in druntime?
I'd like to know more.


> Well you're right,D does have fewer libraries.  Only 1400 on code.dlang.  But you also have all of C.  And I guess being able to use most of C++ will be a gain again also because it helps with incremental transitions of larger code bases.  Might still be some problems where you can't represent C++ types in D, but ask Atila about that.
> It's easier for D than for Rust in this respect.

Agreed

November 16, 2018
On Friday, 16 November 2018 at 09:03:48 UTC, Francesco Mecca wrote:
> On Wednesday, 14 November 2018 at 19:39:42 UTC, Laeeth Isharc wrote:
>
>> DPP already helps I think.  As does dstep.  Don't forget also the work to get STL types into druntime.
>>
> Do any of you have any information regarding the STL types in druntime?
> I'd like to know more.

https://github.com/dlang/druntime/tree/master/src/core/stdcpp

std::string is waiting on implementation of DIP1014 due to an interior pointer in the GNU implementation.

November 16, 2018
On Wednesday, 14 November 2018 at 15:07:46 UTC, lagfra wrote:
> https://www.reddit.com/r/cpp/comments/9vwvbz/2018_san_diego_iso_c_committee_trip_report_ranges/
>
> By 2020 C++ is planning to introduce:
>
> * Ranges
> * Contracts
> * Concepts (`__traits`)
> * Proper constexpr
> * Modules
> * Reflections
> * Green threads
>
> Right now it already has:
>
> * `auto` variables
> * Ranged for (`foreach`)
> * Lambda expressions and closures
> * `nothrow` attributes
> * Proper containers
> * Proper RAII
>
> In no way this is the usual trollpost (I am a participant of SAoC). What bugs me is the shortening distance regarding what D has to offer with respect to C++. While D for sure has a way better syntax (thinking of template declarations, `immutable`, UDAs) and a GC, what are the advantages of using D vs C++ if my goal is to build a complex system / product?
>
> TL;DR: what will D offer with respect to C++ when almost all key features of D are present in C++20(+)?

Even if they're present in C++20 or later, they might not work the same or be as good. C++17 has `if constexpr`, but it's not as good as `static if`.

Having used most of the modern C++ features and writing D daily, here's my personal opinions of why D is still / will still be better:

* The GC. It's just easier to write safe code by default.
* DIP1000
* auto is easier to use in D (no need for `const auto` or `static auto`, or...
* Compile-time reflection. Whatever C++ gets is likely to be worse, because of:
* string mixins
* Lambdas are harder to use in C++ and have lifetime issues with captures by reference
* Headers / modules.
* UFCS and chains, even though the new C++ ranges will mitigate this
* Sane template metaprogramming, but void_t is nice
* Syntax for slices

Is writing C++17 much better than C++03? Indubitably. Is it as nice as writing D? In my opinion, no - I'm 2x to 3x more productive to begin with in D and end up writing fewer bugs.

D is still rough around the edges when it comes to implementation quality. I've never had C++ projects break due to a compiler update, nor have I ever filed a clang or gcc bug. CMake is horrible but I can get the job done, whereas I have to work around dub all the time. Right now my main source of cortisol is the ridiculously long edit-test cycle, but I'm working on something to make that part of my work life a lot happier.


November 16, 2018
On Friday, 16 November 2018 at 13:10:19 UTC, Atila Neves wrote:
> I've never had C++ projects break due to a compiler update, nor have I ever filed a clang or gcc bug.

But that's because C++ is way older than D and has had a lot more work done to it.

C++ hasn't always been elegant and I'll bet you Walter can come up with a lot of issues with C++ from back when he worked on C++ compilers.

Clang and GCC do have a lot of bugs too though, but they're usually much more "precise" and not so much "general" as most bugs in D, but eventually D will reach the same level.

I have never had any breakage because of a D compiler update in my own projects for the past 2+ years, but I have with 3rd party libraries though, so I'm not entirely free of that either.

As long as D is as open as it is, then I think it'll continue to have breakage with each bigger release.

The good thing though is that it's usually not necessary to update your compiler version and you can generally wait a few versions until you update and that way you can skip most breakage.
November 16, 2018
On Friday, 16 November 2018 at 13:10:19 UTC, Atila Neves wrote:
> I've never had C++ projects break due to a compiler update, nor have I ever filed a clang or gcc bug.

I used to regularly hit problems around 2005-2007ish in C++, including updates breaking stuff, libraries using new stuff that would not work in my install, and yes, plain old bugs like compiler crashes (lots of them when trying to use Boost back then!). Of course, "plain" code would work well, but I can say the same about D now too.

I'd say feature-wise, D is about 4 years ahead of C++, but implementation-wise, meaning the compiler and associated ecosystem probably about 8 years behind C++...
November 16, 2018
On 11/14/2018 07:57 AM, jmh530 wrote:
> On Wednesday, 14 November 2018 at 15:49:48 UTC, jmh530 wrote:
>> [snip]
>>
>> I recall D being briefly mentioned in the Range specification. They rejected D's approach because they wanted to build on existing iterator-based code.
> 
> It's actually quite a bit more than I remembered:
> 
> https://ericniebler.github.io/std/wg21/D4128.html#iterator-operations-are-primitive 
> 

Eric appeared on D forums after his range presentation on the following thread where Walter responded with the history of ranges here:

  https://forum.dlang.org/thread/hatpfdftwkycjxwxcthe@forum.dlang.org

Ali
November 16, 2018
On Friday, 16 November 2018 at 07:20:25 UTC, Laeeth Isharc wrote:
>>
> Starting again from scratch may or may not be a good idea, but it won't exactly help with maturity or for many adoption.  "I think I will wait till D3 is ready".

Maybe, a tool like python 2to3 would facilitate the transition from D2 to D3?
Or perhaps a D2 branch maintained for a limited amount of time like a year. In general, the longer the migration phase is, the less likely an actual migration effort would occur.


> I don't know but any fixing of past mistakes seems to me a much smaller change than D1 to D2 and so I don't know if it is the ideal framing.  It's more like D 2.1 although then the versioning of releases gets a bit confusing.
>

I think the currently failed semantic versioning is going to find a simple fix when D 2.100.0 will be released eventually, where the leading "0" character won't matter anymore.

>> The creators and the main contributors of D are all C++ full-time developers

>>  some of them even members of C++ commities.
>
> Traitors!  We must hunt them down and expel them!  Seriously,how can this be a bad thing?  Some people are even members of non-native code communities also!  Why wouldn't we want to have the benefit of the idea interchange that results ?

Please, don't turn me into a parody :/ I don't see them as traitors of course, I know they put a lot of effort into the D language and it's a wonderful thing for our community to have several semi-gods among us.
But my point is, I'm persuaded they believe much more in C++ than they believe in a future for D; the latter being rather a technological demo for something they would have hope at the beginning of their career.

>> For example, Walter distribute and commercialize a C++ compiler
> That's his old gig and he keeps something going I guess, but it doesn't look to me like he is putting much time into DMC.  When is the Cpp 2017 version coming out?  My guess is never.
>
>  > And Andrei contribute to C++ meeting in order to
>> identify and improve the weaknesses of C++...
>
> And they often don't listen and mess it up when they do, just like with static if.  How is this a bad thing?  If C++ gets better,I really don't think it's bad for D.

I am not sure it is a good thing either. At best, the original idea from D concept is pointed out in the C++ changelog but that provide not visibility or credit at all for D design, or D market in extenso.

>
>> D cannot grow and develop its own identity if the main focus is C/C++ compatibility.
>
> Do you really think that's the case that it's the main focus?

I admit I have exagerated, there are lot of efforts committed towards PRs managing, DIPs processing, DMD optimization, newCTFE and probably more. But Andrei told us about 18 months ago he had a female student under scholarship from the D foundation who was working on D3 and we have no news since the teasing.
So, I would like to know whether this kind of project will happen :)


>> Make no mistake, nobody will abandon his job in C++ among the D community to persuade a employer to hire him for a D full-time job
>
> :)
>
> There are no jobs in D :)
>
> I'm pretty sure you are mistaken both on the supply and demand side.

I don't understand, what do you imply?

> And we are still hiring.

Nice but for which tech?
To be honest, 2 years ago, I was hoping D would be ready to work with full-time, but to the best of my knowledge, there are no D jobs in France and it's a great frustration.

>> I wish I haven't hurt anyone's feelings but D project lack a bit of long-term vision.
>
> I think right now the vision is clear enough as far as it needs to be articulated and the biggest constraint is that the D Foundation hasn't been in existence for long and it's quite a lot of work to create something from nothing and it takes time from beginning to start to see results though if one pays attention I don't think it's hard to see plenty of results already.
>
> Everything is an S curve - very flat in the beginning.

Agreed, but the beginning was in 2001 for D you know... :x It's not like it was previous year.
Anyway, thanks for your input Laeeth Isharc :)