Thoughts on Rust vs. OCaml
Yeah, trying to translate code from OCaml the number one most annoying thing was limitations around pattern matching.  I think in general you run into this sort of thing a lot if you try to either treat Rust as a functional programming language like OCaml, or are writing the sort of thing that inherently benefits from garbage collection.  However, there is actually a trick that can (if you don&#x27;t need cleanup) both improve your performance and give you back pattern matching: allocate your nodes in something like <a href="https:&#x2F;&#x2F;docs.rs&#x2F;typed-arena&#x2F;2.0.1&#x2F;typed_arena&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.rs&#x2F;typed-arena&#x2F;2.0.1&#x2F;typed_arena&#x2F;</a> instead of as Rcs.  Doing this (especially if you tend to stick to immutable stuff, but even if you don&#x27;t if you&#x27;re careful) can make using Rust for manipulating ASTs and stuff a lot more pleasant (though it does have other tradeoffs, obviously, and you usually end up needing both kinds of representation at different points--which I guess speaks to your point about there being way too many ways to do things and too many rules about how to do them).