Stream: beginners

Topic: Zig-style error handling?


view this post on Zulip Unshipped9094 (Dec 24 2025 at 21:43):

I vaguely recall hearing/seeing that the new syntax for Roc was going to adopt something similar to the way Zig does error handling. Am I totally mis-remembering or is there anything someone could point me to? Mostly just curious since I've been learning Zig and finding it pretty reasonable.

view this post on Zulip Unshipped9094 (Dec 24 2025 at 21:49):

Actually, just skimmed through the advent of code doc and think I found it
https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4#the--postfix-operator

increment_first = |strings| {
    first_str = strings.first()?
    first_num = I64.from_str(first_str)?

    Ok(first_num + 1)
}

Last updated: Jan 12 2026 at 12:19 UTC