When comparing Rust vs Reason ML, the Slant community recommends Reason ML for most people. In the question“What are the best languages for learning functional programming?” Reason ML is ranked 14th while Rust is ranked 15th.
Ranked in these QuestionsQuestion Ranking
Pro Catch errors at compile-time
Since Rust is statically typed, you can catch multiple errors during compile time. This is extremely helpful with debugging, especially compared with dynamically typed languages that may fail silently during runtime.
Pro Threads without data races
Unique ownership system guarantees a mutable data to be owned and mutated by only one thread at a time, so there's no data race, and this guarantee is checked at compile time statically. Which means easy multi-threading.
Of course, immutable data can be shared among multiple threads freely.
Pro Compiles to machine code allowing for extra efficiency
Rust uses LLVM as a backend, among other things this allows Rust code to compile down to machine languages. This allows developers to write programs that run as efficiently as possible.
Pro Generics support
You don't have to write same array and dictionary classes hundreds and thousands times for strong type check by compiler.
Pro Support for macros
When you identify a part of your code which gets repeated often, which you cannot abstract using functions or classes, you can use Rust's built-in Macros.
Pro Built-in concurrency
Rust has built-in support for concurrency.
Pro Supports cross compilation for different architectures
Since Rust 1.8 you can install additional versions of the standard library for different targets using
$ rustup target add x86_64-unknown-linux-musl
Which then allows for:
$ cargo build --target x86_64-unknown-linux-musl
Pro Makes developers write optimal code
Rust is a modern programming language written around systems. It was designed from the ground up this way. It's language design makes developers write optimal code almost all the time, meaning you don't have to fully know and understand the compiler's source code in order to optimize your program.
Furthermore, Rust does not copy from memory unnecessarily, to give an example: all types move by default and not copy. Even references to types do not copy by default. In other words, setting a reference to another reference destroys the original one unless it's stated otherwise.
Pro Easy to write understandable code
While not as verbose as Java, it still is much more verbose than languages like Go and Python. This means that the code is very explicit and easy to understand.
Pro Official package manager and build tool
Cargo is the official package manager for Rust. It comes with the language and downloads dependencies, compiles packages, and makes and uploads distributable packages
Pro Functional Programming
Very easy to create functional with some additional from structure application.
Pro Big community
The biggest community contributing to language.
Pro Zero-cost futures or Async IO
Pro Superior type inference
Ocaml type inference is so smart that you never have to repeat yourself and keep code very clean, type errors also are very pleasant
Pro Immutability with escape hatches
reason includes true immutability, but it has escape hatches to let you use mutations in exceptional cases.
The same reasonml code can compile to js (eg. run on browsers or node.js, use any lib in npm), or compile to assembly thru ocaml (unless of course you load js externals), running on any device, with C-comparable (or better) performance.
Pro JSX syntax natively supoorted
reason was created by the creator of react, for developers already using JSX to template web or native UIs this results very familiar
Con Hard to find learning resources or libraries
Because it's still a relatively new language, Rust does not enjoy a following as large as other languages/environments. Rust development has also been rather volatile for a long time during the beginning of the development of the language adding to this issue.
Because of the small community, it's harder to find useful libraries for projects or any other kind of resource.
Con Asynchronous I/O is not (yet) a part of the core language
The issue of asynchronous I/O is still being discussed as a language feature, and not yet in the implementation phase. See the RFC on GitHub here.
Con Very new and untested
Con A standard async syntax is pending
Async syntax is not standard across native/js projects and in both cases a bit awkward for non-ocaml devs. Currently this is reasonml most voted issue in their GitHub repo so hopefully, there's news soon.