News for hackers. Stuff that matters.
Re:Some were meant for C [pdf] by retrac on Wednesday June 21, 2023 @06:44PM (#36425723)
Sum types. In C they can be constructed out of unions and structs with lots of checks (and possibility for error) but it's painful.

There's really no excuse for C not having them, other than C being designed before algebraic types became mainstream. They make certain programming errors impossible, particularly with null values and misusing a union with the wrong type. It is possible to compile them as a zero-cost abstraction, and essentially all recent languages aimed at the same domain as C (Rust, D, Go, Zig, Hare, etc.) include them.

Re:Some were meant for C [pdf] by anacrolix on Wednesday June 21, 2023 @06:55PM (#36425841)
Go goes NOT have sum types. I'm not sure Zig technically does, but is close enough.