OT: C# now has ref and const ref return

Bert Bert at gmail.com
Tue Aug 6 11:59:04 UTC 2019


On Tuesday, 6 August 2019 at 09:54:49 UTC, XavierAP wrote:
> https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref#reference-return-values
>
> This is a good example how C# is getting very competitive not 
> only on the high-productivity segment (which Dlang currently 
> neglects relatively), but expanding into higher performance. 
> The only point of these new features is to enable writing C# 
> code that does not allocate in the GCed heap. I think D should 
> pay attention
>
> See also:
> https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref#ref-struct-types
>
> Syntactical design-wise they have opted for total explicitness. 
> Everything has to be decorated ref: function declaration, 
> return statement, and local variable declaration at caller 
> scope. (This makes it look at first like it's allowing ref 
> local variable declarations like C++, but I understand -- 
> haven't played with it yet -- that in reality it's only allowed 
> at the left side of calls to ref return methods.) I guess this 
> explicit approach may be safer and works for C# since it by 
> design doesn't have templates/heterogeneous generics, but 
> polymorphic/homogeneous.
>
> Note in case you're not familiar that C# readonly means D 
> immutable and C# const means D enum.

Eventually D will not be competitive at all. Simple as that. 
These other languages are always moving forward in all 
directions. D inches along in a few. It's just a matter of time. 
D is about 20 years too late and the "leadership" is more 
concerned with conferences and "swag" than getting D competitive. 
Computation is expanding in all domains. Programming is not just 
about writing device drivers or controlling relays any more... 
Without proper user support tooling D will fail. It's just a 
matter of time. Just like a biological population there is a 
requirement of a certain minimum number of users to sustain D. 
The D downloads is touted as "Look, the number of downloads are 
growing, it means D is growing!! D is on the right track!"... but 
yet 1. The number of humans getting in to computing is growing 
and 2. The actual users of D are not growing in step. People 
download D, try it, and realize it sucks and it's not for them. 
Sure a few love D, they see the beauty of it and ignore or 
neglect the other issues.

I'm about 10x as productive in other languages than D. It's not 
the language itself as it is everything around it. It's great for 
minor things like utilities or simple one offs but few in the 
right mind will use D for anything major(as a serious massive app 
targeted as the real public).

I imagine D will simply become a support language that can be 
used to write certain things well in and then eventually some 
other better language with better support will come along and 
replace D. That is the direction D is headed and the leadership 
refuses to accept it. They keep looking at the pros of D and 
completely ignore the cons.... eventually the cons will catch up 
and overtake the pros and then it's just a matter of time. The 
leadership is myopic and that what is killing D... and it's 
probably too late to save it. They are stuck in the past and 
entropy will do what it always does and at some point it will be 
more trouble to keep D alive than it will to just move on. Sure 
there will always be a few hanger ons but that will be the future 
of D it seems.





More information about the Digitalmars-d mailing list