Get the latest tech news
Algebraic Data Types for C99
Algebraic data types for C99. Contribute to Hirrolot/datatype99 development by creating an account on GitHub.
Such things as improperly typed variants, non-exhaustive pattern matching, and invalid field access are caught at compile-time. Datatype99 is used at OpenIPC to develop real-time streaming software for IP cameras; this includes an RTSP 1.0 implementation along with ~50k lines of private code. The reason is this: match(val) boils down to switch(val.tag) under the hood, with val.tag being an ordinary C enumeration consisting of the variants Foo and Bar.
Or read this on Hacker News