Re: forcing "@nogc" on class destructors

2015-01-29 Thread Jerry Morrison via Digitalmars-d
On Wednesday, 28 January 2015 at 11:32:26 UTC, Ola Fosheim Grøstad wrote: But I think GC and destructors are not a good match... so I would personally go for performance and no destructors. Yes. That is the bottom line. A good match for GC is the phantom reference, which notifies you when an

Re: forcing "@nogc" on class destructors

2015-01-27 Thread Jerry Morrison via Digitalmars-d
From the forum thread http://forum.dlang.org/thread/ossuvfmqthllgdpgz...@forum.dlang.org?page=1 and the PR https://github.com/D-Programming-Language/dlang.org/pull/851 I learned that allocation in a destructor isn't the only crash case here. The GC calls a class instance's invariant() meth

Re: forcing "@nogc" on class destructors

2015-01-27 Thread Jerry Morrison via Digitalmars-d
On Tuesday, 27 January 2015 at 22:46:30 UTC, Ola Fosheim Grøstad wrote: On Saturday, 24 January 2015 at 23:28:35 UTC, Jerry Morrison wrote: On Saturday, 24 January 2015 at 15:04:47 UTC, Ola Fosheim Grøstad wrote: If the classes are written for RAII then the destructors have to be called in reve

Re: forcing "@nogc" on class destructors

2015-01-24 Thread Jerry Morrison via Digitalmars-d
On Wednesday, 21 January 2015 at 20:32:14 UTC, Steven Schveighoffer wrote: Actually there's nothing on the documentation about class destructors [1] that warns about that specific issue of the current (and default) GC. [1] http://dlang.org/class.html#destructors I think the docs are in need

Re: forcing "@nogc" on class destructors

2015-01-24 Thread Jerry Morrison via Digitalmars-d
This is the first I've heard that allocating GC memory in a destructor will crash. That's an unexpected gotcha. I'd expect to be able to reliably do I/O or throw an exception. Strategy 1. Fix the GC's limitation. (One fewer pitfall to baby-sit.) Strategy 2. Have the compiler inform the progr

Re: dlang.org redesign -- the state of documentation and learning resources [part 2]

2015-01-23 Thread Jerry Morrison via Digitalmars-d
After spending hours and hours in a breadth-first scan to learn me a D, I agree completely with the suggestions in this thread and I'm happy to help implement them. Caveats: I'm just now coming up to speed on D and I'm an engineer, not a tech writer. I think the biggest needs are: (1) Impro