3 ms·
throw/catch is more readable, because panic/recover doesn’t switch on type and isn’t block scoped (the defer stack is set up at runtime, which also can’t be goo
by erik_seaberg 6y ago
throw/catch is more readable, because panic/recover doesn’t switch on type and isn’t block scoped (the defer stack is set up at runtime, which also can’t be good for the optimizer).
- dilap 6y agothat's sort of a feature though, since it makes it less likely to be used ;-) rust, i believe, can also recover from panics, but it's even less ergonomic, which makes it even more of a feature zig goes to the extreme and makes panics completely unrecoverable, tho it's unclear how practical that is for e.g. long running servers w/ many clients interesting discussion here: https://github.com/ziglang/zig/issues/3516 https://github.com/ziglang/zig/issues/3516