Skip to content

Motivations for exceptions vs panic/recover + algebraic types ? #1294

Answered by dabrahams
adevress asked this question in Q&A
Discussion options

You must be logged in to vote

This is the only thing I can interpret as a question above:

I am wondering about the motivations behind this choice

I'll try to respond to that; to the rest, I mostly can only say, "noted!"

Exceptions improve a large category of relatively high-level code that would otherwise include a lot of "check the result to see if it's an error (or a concurrent task cancellation) and if so return it; otherwise unwrap it and continue" boilerplate. Hylo is not trying to be an exclusively-low-level programming language, and that higher-level code is much worse and harder to reason about with the boilerplate included. Also, by distinguishing errors (i.e. postcondition failures) in the language we can …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@adevress
Comment options

Answer selected by adevress
Comment options

You must be logged in to vote
1 reply
@dabrahams
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants