2 ms·
They’re quite different languages in almost every way. Rust is a low level systems language, where you care about memory. You may not be malloc’ing, but you’re
by ddek 6y ago
They’re quite different languages in almost every way.
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.