Hacker News new | ask | show | jobs
by eiurafhlfie 2742 days 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.
2 comments

> OCaml, F#, Haskell, and Rust

If you change Rust to ML, the phrase would be way more natural.

How many non-toy non-self compilers and interpreters are written in Rust?
There’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.