Advantages of OCaml over Rust

I don’t know that most people here (including myself) are qualified to answer this question. From what I do know of Rust, you still have the mental overhead of keeping track of linear types and their lifetimes. This is very powerful, but also a burden when trying to do things that don’t need the highest performance level possible. Rust also doesn’t give you garbage collection by default – you have to add it in using a library, which is probably not as convenient. Finally, Rust really compromised in terms of syntax: its original syntax was functional, but it eventually adopted a more C++ like syntax since those were the programmers they were trying to lure to the language.

Most applications will probably be simpler to program in OCaml rather than in Rust. At the same time, if you’re writing an OS or a performance critical tool, Rust will guarantee performance around the level of C++, making the extra cognitive burden worthwhile.

7 Likes