News for hackers. Stuff that matters.
Re:Structurally-Typed Condition Handling by catlifeonmars on Tuesday February 15, 2022 @05:04PM (#30353446)
> Every single caller between the handler and condition site has to be able to handle both the happy path (got a result) and unhappy path (got a condition).

This isn’t terrible, 2 relatively popular languages, Rust and Go, do not have exceptions and do require the caller explicitly handle errors. Rust even has a question mark operator to make error handling this way a bit more ergonomic.

> Another issue is just in performance. In an error or try/catch system you unwind the stack along the way. In a condition system, you don't.

That makes sense. I’m curious if this is something that can be optimized statically by a compiler.

There are no comments on this comment yet.