Jump to page: 1 27  
Page
Thread overview
OT: C# now has ref and const ref return
Aug 06, 2019
XavierAP
Aug 06, 2019
Simen Kjærås
Aug 06, 2019
Bert
Aug 06, 2019
Ernie
Aug 06, 2019
Suliman
Aug 06, 2019
GreatSam4sure
Aug 07, 2019
Ali
Aug 06, 2019
JN
Aug 06, 2019
Manu
Aug 07, 2019
Ethan
Aug 06, 2019
Walter Bright
Subject
Aug 07, 2019
Exil
Aug 07, 2019
Mike Parker
Aug 07, 2019
Walter Bright
Aug 07, 2019
Paulo Pinto
Aug 07, 2019
Ali Çehreli
Aug 08, 2019
Walter Bright
Aug 08, 2019
Maximilian
Aug 08, 2019
Walter Bright
Aug 08, 2019
Russel Winder
Aug 08, 2019
Paulo Pinto
Aug 08, 2019
Russel Winder
Aug 08, 2019
Walter Bright
Aug 08, 2019
Exil
Aug 08, 2019
Ethan
Aug 09, 2019
Exil
Aug 09, 2019
bachmeier
Aug 09, 2019
Ethan
Aug 09, 2019
Laurent Tréguier
Aug 09, 2019
Ethan
Aug 09, 2019
Laurent Tréguier
Aug 09, 2019
Ethan
Aug 09, 2019
Murilo
Aug 09, 2019
matheus
Aug 07, 2019
Exil
Aug 08, 2019
Walter Bright
Aug 07, 2019
Exil
Aug 08, 2019
Walter Bright
Aug 08, 2019
Exil
Aug 08, 2019
Atila Neves
Aug 08, 2019
a11e99z
Aug 08, 2019
a11e99z
Aug 09, 2019
drug
Aug 09, 2019
drug
Aug 09, 2019
Exil
Aug 07, 2019
Ethan
Aug 07, 2019
XavierAP
Aug 07, 2019
bachmeier
Aug 07, 2019
Ethan
Aug 07, 2019
Bert
Aug 07, 2019
Adam D. Ruppe
Aug 07, 2019
Ethan
Aug 07, 2019
Paulo Pinto
Aug 07, 2019
jmh530
Aug 07, 2019
Ethan
Aug 07, 2019
jmh530
Aug 07, 2019
Ethan Watson
Aug 07, 2019
JN
Aug 07, 2019
a11e99z
Aug 09, 2019
xenon325
Aug 09, 2019
Thomas Brix Larsen
Aug 07, 2019
SashaGreat
August 06, 2019
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.
August 06, 2019
On Tuesday, 6 August 2019 at 09:54:49 UTC, XavierAP wrote:
> (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.)

It seems to me C# ref variables are very much like C++ ref variables (tested and works ;on my machine):

using System.Diagnostics;

class C
{
    static void Main()
    {
        var i = 3;
        ref int ir = ref i;
        ir = 17;
        Debug.Assert(i == 17);
    }
}

Can't have const references to literal values (e.g. const int& i = 13;) like in C++, though.

--
  Simen

August 06, 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.



August 06, 2019
On Tuesday, 6 August 2019 at 11:59:04 UTC, Bert wrote:
> I'm about 10x as productive in other languages than D.

Then go use those languages. Don't come here brood like a mofo.
August 06, 2019
Personally I moved from D, to Dart because it's more look like D3. A lot of modern and useful futures.
August 06, 2019
On Tuesday, 6 August 2019 at 14:25:05 UTC, Suliman wrote:
> Personally I moved from D, to Dart because it's more look like D3. A lot of modern and useful futures.

You have move way to dart what is still keeping you around. Will you be a gain to the dart community. Will the D community miss you?
August 06, 2019
On Tuesday, 6 August 2019 at 14:25:05 UTC, Suliman wrote:
> Personally I moved from D, to Dart because it's more look like D3. A lot of modern and useful futures.

I love Dart. I think it's one of the cleanest languages around. I love the language and I love the tools surrounding it (IDE support is quite nice). Unfortunately, it lacks value types and it's not really usable outside of web/server context.
August 06, 2019
On Tue, Aug 6, 2019 at 5:01 AM Bert via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> 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.

I feel your sentiment, but I think you're wrong about some outcomes.
D is limited by developer manpower. It's not clear how to improve that.
I've been banging on and on and on and on about developer experience
for a very long time, and it is actually moving, but it's
under-staffed.
VisualD is actually a very good tool, but with some gaps. Compared to
any other language integration into Visual Studio, I don't know of
many experiences better than VisualD.
VisualD is 1-man, and if there were 2, I think it would make a world
of difference... so reasonably progress is happening, just not at an
enjoyable rate.

Now your end-game though, I think that's a bit un-realistic. I expect,
the moment that a substantial number of the D users feel like things
are going in a completely wrong direction, or their progress is being
inhibited behind a threshold that's unacceptable, D will fork.
D exists because it's not as bad as you say, and the day that it
becomes as bad as you say, it will fork... that fork under new
leadership may see some rapid progress initially, but it's understood
that the integrity of the community is a balancing factor against that
progress.
It's hard to say exactly where that balance is, but I'm fairly
confident it exists, and as soon as the threshold is crossed, it will
fork. We haven't forked because D is not currently as bad as you say.
August 06, 2019
The imminent demise of D was confidently predicted 20 years ago, and every year since, yet it keeps growing and getting better. The imminent failure of Zortech C++ was also constantly predicted by pretty much everyone, meanwhile Zortech was pretty successful.
August 07, 2019
On Tuesday, 6 August 2019 at 23:55:11 UTC, Walter Bright wrote:
> The imminent demise of D was confidently predicted 20 years ago, and every year since, yet it keeps growing and getting better.

It won't be imminent but it hasn't reached the point of self sufficiency. I don't see it reaching the same level of success as other younger languages, at it stands.

> The imminent failure of Zortech C++ was also constantly predicted by pretty much everyone, meanwhile Zortech was pretty successful.

They weren't wrong, Zortech C++ doesn't exist anymore. While C++ is still going strong.
« First   ‹ Prev
1 2 3 4 5 6 7