4 ms·
That's a very broad question. Rust does the things that I would say are table stakes for a decent programming language these days: decent type system (similar s
by lmm 11y ago
That's a very broad question. Rust does the things that I would say are table stakes for a decent programming language these days: decent type system (similar safety to Java) with type inference (similar conciseness to Python), a sensible approach to errors (errors are values as in Go, but since Rust is a non-joke language it doesn't need to special-case errors at the language level, they're just another type of value). Its unique thing is the semi-manual (but safe) memory management, but if you needed that then you would know you needed that, otherwise it's not terribly important to you.
So it's a decent language, but there are other decent languages around these days. I tried to compare them at http://m50d.github.io/2015/09/28/when-rust-makes-sense.html http://m50d.github.io/2015/09/28/when-rust-makes-sense.html . I'd look at OCaml first, particularly given their relative maturity levels, but if you really can't stand OCaml's syntax then Rust may be worth a look.
- nindalf 11y ago> it doesn't need to special-case errors at the language level Could you explain this? A lack of explanation makes it seem flippant and is probably why your comment is greyed out.
- lmm 11y agoRust error-handling https://doc.rust-lang.org/book/error-handling.html https://doc.rust-lang.org/book/error-handling.html - Result is just an ordinary type defined in the language. Whereas go's "if err, res" stuff is special-cased - e.g. you can't use your own custom representation of error vs not.