Program logic bugs vs input/environmental errors

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 5 14:51:02 PDT 2014


On Sunday, 5 October 2014 at 20:41:44 UTC, Walter Bright wrote:
> On 10/5/2014 8:35 AM, Dicebot wrote:
>> I am fine with non-default being hard but I
>> want it to be still possible within legal language restricions.
>
> D being a systems language, you can without much difficulty do 
> whatever works for you.

Yes but it shouldn't be in undefined behaviour domain. In other 
words there needs to be a confidence that some new compiler 
optimization will not break the application completely.

Right now Throwable/Error docs heavily suggest catching it is 
"shoot yourself in the foot" thing and new compiler release can 
possibly change its behaviour without notice. I'd like to have a 
bit more specific documentation about what can and what can't be 
expected. Experimental observations are that one shouldn't rely 
on any cleanup code (RAII / scope(exit)) to happen but other than 
that it is OK to consume Error if execution context for it (fiber 
in our case) gets terminated. As D1 compiler does not change it 
is good enough observation for practical means. But for D2 it 
would be nice to have some official clarification.

I think this is the only important concern I have as long as 
power user stuff remains possible without re-implementing whole 
exception system from scratch.


More information about the Digitalmars-d mailing list