Rust is more than a language specification and a compiler; many aspects of building and maintaining industrial quality software are considered first-class objects. With rustup, you can install and manage multiple parallel Rust tool chains. Rust comes with Cargo, a command-line tool for managing dependencies, running tests, generating documentation, and more. Because dependencies, tests, and documentation are available by default, their use is widespread. crates.io is a community site for sharing and discovering Rust libraries. Any library published to crates.io will have its documentation on docs.
In addition to the built-in tools, the Rust community has created many development tools. Benchmarking, analysis, and property-based testing are all easy to use in projects. Additional compiler lints are available in Clippy, and auto-formatting is provided by rustfmt. The IDE support is good and getting better every day.
Rust has a vibrant, welcoming community. There are several official and unofficial ways to get help such as chat, forum, Rust subreddit and of course Stack Overflow. Rust has a code of conduct that is enforced by an amazing team of moderators, so the official portals and most of the unofficial ones are accommodating.
Offline, Rust hosts many conferences around the world, such as RustConf, Rust Belt Rust, RustFest, Rust Latam, RustCon Asia and others.
Not so simple
Rust’s strong type system and emphasis on memory safety—all of which happens at compile time—mean that errors are extremely common when compiling code. This can be frustrating for programmers not used to such an opinionated programming language. However, the Rust developers have spent a lot of time working on improving error messages to make sure they are understandable and usable.
It’s especially common to hear someone complain that they’re “fighting with borrowing checks”. While these bugs can be discouraging, it’s important to recognize that each of the places identified has the potential to lead to bugs and potential vulnerabilities.
In this example, we create a mutable string containing the name, then take a reference to the first three bytes of the name. We are trying to change a string by clearing it. Now references to valid data and dereferencing them can lead to undefined behavior, so the compiler stops us.
Luckily, the error message includes our code and goes out of its way to explain the issue by pointing to exact locations.
Prototyping in Rust can be tricky due to its statically typed nature and because Rust requires 100% condition coverage. Edge cases should be described, even if the programmer does not yet know what should be there.
In the early stages of development, these edge cases can often be eliminated by causing the program to crash, and then strict error handling can be added at a later stage. This is a different workflow and is found in languages such as Ruby, where developers often try code in a REPL and then port it to a prototype without considering error cases at all.
Rust is still a relatively new language, which means that some required libraries may not be available yet. On the positive side, there is a lot of fertile ground to develop these essential libraries, perhaps even using the latest advances in the relevant areas of computer science. Because of this and the power of Rust, some Rust libraries like regex are best in class in any language.
While Rust is firmly committed to stability and backwards compatibility, this does not mean that the language has been finalized. A particular problem may not be solved by language features that would make it easier to express, or perhaps even allow it to be expressed. For example, async futures have been around in Rust for over three years, but stable support for async/await has only been around for a while.