A Philosophy of Software Design
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Sun May 24 02:11:42 UTC 2026
On 24/05/2026 1:42 PM, Walter Bright wrote:
> The first sentence of the chapter "Define Errors Out Of Existence" says:
>
> "Exception handling is one of the worst sources of complexity in
> software systems."
>
> I suspect that adding EH to D was a mistake. It certainly was a mistake
> to build it into Unicode string handling. I'd like to see if we can
> figure a way to do Phobos without exception handling.
I've been attempting to find a way to do that for 3+ years.
Unfortunately you made it so that we can't do value type exceptions. Aka
the compiler converts the throw set + return type into a sum type.
That requires inferring to work, and nothrow is now on the chopping
block due to that.
Which leaves us with result types and unwrapping.
This is my solution to the problem (please ignore the unwrap alias stuff
I did later on, I want to kill that but thats a political problem):
https://forum.dlang.org/post/vcozmhysmztnmngzopnm@forum.dlang.org
This also handles errors without a result type.
More information about the Digitalmars-d
mailing list