3 ms·
Depending on much experience you have with ML-y type systems, Rust will either feel a little boring or like a revelation. The combination of pattern matching an
by rvense 10y ago
Depending on much experience you have with ML-y type systems, Rust will either feel a little boring or like a revelation. The combination of pattern matching and algebraic data types is incredibly powerful and expressive and unlocks a style of coding where what in other languages would be potentially buggy logic that needs to be tested becomes mechanically checked typing information. Often, code can be trusted to just work if the type checker accepts it, which is especially handy if you make major changes to a large programme. Rust also favours immutable data structures, which also means some classes of bugs stop showing up in most cases. I've found these things to be a major productivity enhancement, maybe on par with going from manual memory management to garbage collection.
Which is another reason to be excited about Rust - it is to the best of my knowledge the only new language that allows you to write an entire programme or part of a programme that does no runtime memory allocation. While GC in most languages is not problematic in most cases, this makes it suited for embedded or hard-realtime work where C/C++ may have been the only option up until now. But it still has all these expressive, high-level features and safety mechanisms that makes it so suitable for programming well-structured, trustable software. There's a learning curve moving from GC to the ownership system, and maybe a plug-in garbage collector makes sense in some cases, but then the system does support that.
And then there's the tooling. Setting up a cross-compiler (again, embedded work), bringing in libraries from online repositories, packing up code modules for distribution and reuse, all that, is as easy as you'd expect coming from the web world because of the excellent Cargo system.
In short, while it might not be completely battle-tested yet, I think it has a better shot at being the "one language" that scales from tiny throw-away projects to large, complicated ones, and from watches to super computers than anything else I've seen.