On Tuesday, 6 October 2015 at 22:21:41 UTC, Jonathan M Davis wrote:

So, we're doing better than C# or Java do, but unfortunately,
there are just enough issues with ref-counting structs that to
get it fully right, we do need ref-counting in the language (unfortunately, I don't remember all of the corner cases that make that the case). So, ref-counting with structs _mostly_ works, and it is a solution, but it's not quite where we want it to be, which is Walter and Andrei have been talking about adding ref-counting support to the language and DIP 74 was proposed.

I'll give you that. The situation is slightly better than C#.

But these problems still exists:

-structs can be nested in classes, and inherit the non-deterministic lifetime of classes. The designer of a library has no control over this.

-classes that are meant to be ref counted(meaning that they depend on their destructor being called in a timely fashion) are not guaranteed to be wrapped in a RefCounted or similar RAII object. Again, the designer of a library has no control over this.

-again, alias this allows class references to escape their RAII containers and can cause access violations as show here:
http://forum.dlang.org/post/[email protected]

-The syntax is annoying(this is a lot more important that people in this forum usually want to believe)

-wrapper structs hide the real type of the object from templates, typeof(), etc..

-etc..


_Is_ it just the interim? Will DIP74 actually ever be implemented? if so, when?

We don't know. It hasn't been officially accepted yet. Walter and Andrei could change their minds and decide that it's not necessary to add ref-counting support to the language. It could be that DIP 74 or something like it ends up being accepted and implemented in a year or three.

If it takes long enough that C++ has reflection, modules, ranges, stackless coroutines, concepts, etc, then I gotta be honest, I'm gonna start worrying about investing too much time in D.

I'd be shocked if it were this year, and depending on what
Walter and Andrei are focusing on, it could be longer than that.

I hope you're wrong. It's one thing to move slow, but looking at DIP74, it doesn't seem to be moving at all(last updated 2015-03-04)


But based on questions on SO and stuff in D.Learn and other
places online, it's pretty clear that at minimum, many folks that are
new to D use classes even when they don't need polymorphism.

Yes, that's why they're asking question in D.Learn and SO... :)

There seems to be a general trend in software these days where developers are getting lazy, and saying "But no one is asking for it" and using that to justify leaving features out. This approach doesn't take into account people that just _expect_ certain features to be present because they're so obvious.

If you went to a Pizza Hut and they gave you a pizza with no cheese on it "because no one asks for it", would you actually say anything, or just dismiss them offhand and go somewhere else?

There is something to be said for tradition. Not everything has to be a democracy..

    Bit




Reply via email to