Re:OCaml for the Skeptical: OCaml in a Nutshell (2006)
by jon_smark on Sunday August 02, 2020 @03:14PM
(#24030851)
> Conversely OCaml is an interpreted functional language.
Correction: OCaml is not an interpreted language. OCaml programmes are compiled down to native code (or bytecode, or Javascript).
Rust is a low level systems language, where you care about memory. You may not be malloc’ing, but you’re borrowing.
Conversely OCaml is an interpreted functional language. It has a much richer and more concise syntax than rust.
You can’t define operators in rust. That means no ‘|>’, no parser combinators. I doubt I’ll ever write a parser in a non-ML language, after my experiences with FParsec.
Rust can’t do partial application properly. I can’t compose functions in rust.
Don’t get me wrong though - Rust is a fantastic language and miles ahead of similar languages in terms of functional features. The only popular C-like language that’s catching up is C#, but discriminated unions aren’t due until next autumn.
Rust is better for manipulating a computer, OCaml is better for math-ey things such as parsers.
You should try OCaml, even if you don’t use it you’ll learn about programming from it.