4 ms·
Tagged union types (called `enum` in Rust), recursion, and pattern matching are great for tree data structures, such as ASTs, and help catch many bugs. This is
by eiurafhlfie 8y ago
Tagged union types (called `enum` in Rust), recursion, and pattern matching are great for tree data structures, such as ASTs, and help catch many bugs. This is the reason why so many compilers, typecheckers, and interpreters are written in languages like OCaml, F#, Haskell, and Rust.
- snaky 8y ago> OCaml, F#, Haskell, and Rust If you change Rust to ML, the phrase would be way more natural.
- n-gate 8y agoHow many non-toy non-self compilers and interpreters are written in Rust?
- steveklabnik 8y agoThere’s at least a few; cranelift is powering stuff in production at Fastly. Facebook is writing a MIR interpreter to do static analysis, don’t think that’s production yet though.