Phobos 3 Discussion Notes - 02-01-2024

Adam Wilson flyboynw at gmail.com
Sun Feb 4 01:14:56 UTC 2024


On Saturday, 3 February 2024 at 11:54:48 UTC, ryuukk_ wrote:
> Oh, and Exception Handling?
>
> Get in native tuple and tagged union in the language, and 
> you'll be able to build nice error handling code
>
> I hope no EH in Phobos 3

The EH problem has two potential answers.

The first is the sumtype answer. That would be zero runtime cost 
and would achieve a similar result as the current EH scheme.

The second is that, absent sumtype exceptions, Phobos will be 
designed to not use exceptions wherever possible. There will 
always be cases where exceptions are needed so we can't entirely 
rule them out, but any time one is added it will require some 
serious justification.

This goes back to not wanting to box ourselves into any tight 
corners or inferior designs in the name of slavishly attempting 
to a too-restrictive standard. Consider this potential problem, 
we completely eradicate EH in Phobos 3, create a number of 
less-than-ideal implementations, and then the next Edition of D 
drops with sumtype exceptions and now we have to go back and 
rebuild all those known inferior designs because EH became 
acceptable to the crowd again.

It is better to build the best design up-front, pay a small 
penalty for it, then work on minimizing the penalty.




More information about the Digitalmars-d mailing list