News for hackers. Stuff that matters.
Re:(On | No) Syntactic Support for Error Handling by joaohaas on Tuesday June 03, 2025 @06:50PM (#44175615)
It was not forgotten. Maybe/Either and 'do-notation' are literally what Rust does with Option/Result and '?', and that is mentioned a lot.

That said as mentioned in a lot of places, changing errors to be sum types is not the approach they're looking for, since it would create a split between APIs across the ecosystem.

Re:(On | No) Syntactic Support for Error Handling by dcow on Tuesday June 03, 2025 @07:39PM (#44175913)
Where there’s a will there’s a way. Swift is almost universally compatible with objective-c and they are two entirely different languages no less. If an objective-c function has a trailing *error parameter, you can, in swift, call that function using try notation and catch and handle errors idiomatically. All it takes is for one pattern to be consistently expressible by another. Why can’t Result/Either types be api-compatible with functions that return tuples?
Re:(On | No) Syntactic Support for Error Handling by joaohaas on Wednesday June 04, 2025 @09:46AM (#44180705)
As I mentioned, it's the same method Rust uses, and there are multiple reasons on the papers linked on why that is not desired.
Re:(On | No) Syntactic Support for Error Handling by dcow on Wednesday June 04, 2025 @05:26PM (#44185719)
I didn't say desired. It would work. Do it and if nobody uses it then so be it. Don’t balk and say “well we could but the elite minds in charge have high quibbles with how it would affect the feel of the language in this one absurd edge case, so we won’t”. Just special case the stupid pattern.
Re:(On | No) Syntactic Support for Error Handling by Yoric on Tuesday June 03, 2025 @07:32PM (#44175877)
Indeed, I can testify that `?` was very much designed with the do-notation in mind.