Proposal 2: Exceptions and @nogc

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 9 16:14:08 PDT 2017


On Sunday, 9 April 2017 at 03:26:14 UTC, Walter Bright wrote:
> My previous version did not survive implementation. Here's the 
> revised version. I have submitted it as a DIP, and there's a 
> trial implementation up:
>
>     https://github.com/dlang/dmd/pull/6681

1. This still adds another special case to the language under the 
guise of not breaking backward compatibility. This is exactly how 
C++ became the mess it is today.

2. You're adding in ref-counting in an area where it's only 
available to one very specific part of the language. This is one 
of the reasons people don't like Go: it offers language features 
only in specific places at the compiler devs discretion. It would 
be far better to ACTUALLY add in ref-counting as a real part of 
the language (like Andrei has been pushing for the past two 
years, RCStr anyone?). Or to go with deadalnix's scheme which 
would allow it to be part of the library and @safe. This would 
allow it to be used in other areas in user code where it makes 
sense.

For the fourth time:

You're missing the forrest for the trees. D needs a general 
solution to the problem of GC code in Phobos. This tackles one 
specific area via special case but leaves every other GC 
allocation in Phobos, with no way to make it @safe @nogc. These 
will either require the holistic approach eventually or more 
special cases.


More information about the Digitalmars-d mailing list