DIP 1008 Preliminary Review Round 1

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri May 26 18:27:24 PDT 2017


On 5/26/2017 11:58 AM, Atila Neves wrote:
> On Friday, 26 May 2017 at 16:36:16 UTC, Walter Bright wrote:
>> On 5/26/2017 4:50 AM, Steven Schveighoffer wrote:
>>> But to answer your question, don't mark the exception scope in that case. The 
>>> compiler should complain if you copy it outside the scope, no?
>>
>> I suspect if you proceed with that line of reasoning, you'll wind up in the 
>> same place I did with DIP 1008.
> 
> Could you explain the line of reasoning that led you do dip1008? Thanks,

Follow every construct that enables a reference to an Exception to escape and 
figure out what you're going to do about it. After all, the call to free() must 
happen exactly once per Exception that was allocated with malloc(), and one must 
also deal with GC allocated Exceptions in the mix. A typical omission is not 
considering with the rethrow case nor the chaining case.

Pragmatically speaking:

Counter-proposals that don't do this are legion and I've critiqued a lot of them 
for missing crucial cases. I'm getting more reluctant to continue doing that, so 
I ask submitters of them to be both much more complete, and if they are complete 
solutions, provide a rationale as to why they are better than DIP 1008 rather 
than being arguably equivalent.

Also keep in mind that DIP 1008 has an implementation sitting in the PR queue, 
and it's fairly simple. Solutions that require redesigning D or the compiler or 
both are not likely to get much traction. The list of things I have to do next 
reminds me of trying to run up the down escalator while it constantly increases 
speed.


More information about the Digitalmars-d mailing list