Five Years of Rust Outline

Introduction

Tktktk

Major Changes since 1.0

We've compiled a list of some of the major changes from each Rust's releases since 1.0.

1.2 — Parallel Codegen Compile time improvements are large theme to every release of Rust, and it's hard to imagine that there was a short time where Rust had no parallel code generation at all.

1.3 — The Rustnomicon Our first release of the fantastic "Rustnomicon", a book that explores Unsafe Rust and its surrounding topics has become a great resource for anyone looking to learn and understand one of the hardest aspects of the language.

1.4 — Windows MSVC Tier 1 Support The first tier 1 platform promotion was bringing native support for 64-bit Windows using MSVC (32-bit support arrived in 1.8). Before this you need to have MinGW installed in order to use and compile your Rust programs. This was a massive under taking and now any Windows user can install and write Rust.

1.5 — Cargo Install The addition of being able to build Rust binaries alongside cargo's pre-existing plugin support has given birth to an entire ecosystem of apps, utilities, and developer tools that the community has come to love and depend on. Quite a few of the commands cargo has today were first plugins that the community built and shared on crates.io!

1.6 — Libcore Libcore is a subset of the standard library that only contains APIs that don't require allocation or operating system level features. The stabilisation of libcore brought the ability to compile Rust was one of the first major steps towards Rust's support for embedded systems development.

1.10 — C ABI Dynamic Libraries The cdylib crate type allows Rust to be compiled as a C dynamic library, enabling you to embed your Rust projects in any system that supports the C ABI. Some of Rust's biggest success stories among users is being able to write a small critical part of their system in Rust and seamlessly integrate in the larger codebase, and it's now easier than ever.

1.12 — Cargo Workspaces Workspaces allow you to organise multiple rust projects and share the same lockfile. Workspaces have been invaluable in building large multi-crate level projects.

1.13 — The Try Operator The first major syntax addition was the ? or "Try" operator. The operator allows you to easily propagate your error through your call stack. Previously you had to use the try! macro, which required you to wrap the entire expression each time you encountered a result (try!(try!(expression).method())). Now you can easily chain methods with ? instead (expression?.method()?).

1.14 — Rustup 1.0 Rustup is Rust's Toolchain manager, it allows you to seamlessly use any version of Rust or any of its tooling. What started as a humble shell script has become what the maintainers affectionately call a "chimera". Being able to provide first class compiler version management across Linux, macOS, Windows, and the dozens of target platforms would have been a myth just five years ago.

1.15 — Derive Procedural Macros Derive Macros allow you to create powerful and extensive strongly typed APIs without all the boilerplate. This was the first version of Rust you could use libraries like serde or diesel's derive macros on stable.

1.17 — Rustbuild One of the biggest improvements for our contributors to the language was moving our build system from the initial make based system to using cargo. This has opened up rust-lang/rust to being a lot easier for members and newcomers alike to build and contribute to the project.

1.20 — Associated Constants Previously constants could only be associated with a module. In 1.20 we stabilised associating constants on struct, enums, and importantly traits. Making it easier to add rich sets of preset values for types in your API, such as Ipv4Addr::LOCALHOST.

1.24 — Incremental Compilation Before 1.24 when you made a change in your library rustc would have to re-compile all of the code. Now rustc is a lot smarter about caching as much as possible and only needing to re-generate what's needed.

1.26 — Existential Types The addition of impl Trait gives you expressive dynamic APIs with the benefits and performance of static dispatch.

1.28 — Global Allocators Previously you were restricted to using the allocator that rust provided. With the global allocator API you can now customise your allocator to one that suits your needs. This was an important step in enabling the creation of the alloc library, another subset of the standard library containing only the parts of std that need an allocator like Vec or String. Now it's easier than ever to use even more parts of the standard library on a variety of systems.

1.31 — 2018 edition The release of the 2018 edition was easily our biggest release since 1.0, adding a collection of syntax changes and improvements to writing Rust written in a completely backwards compatible fashion, allowing libraries built with different editions to seamlessly work together.

  • Non-Lexical Lifetimes A huge improvement to Rust's borrow checker, allowing it to accept more verifiable safe code.
  • Module System Improvements Large UX improvements to how we define and use modules.
  • Const Functions Const functions allow you to run and evaluate Rust code at compile time.
  • Rustfmt A new code formatting tool built specifically for Rust.
  • Clippy Rust's linter for catching common mistakes. Clippy makes it a lot easier to make sure that your code is not only safe but correct.
  • Rustfix With all the syntax changes, we knew we wanted to provide the tooling to make the transition as easy as possible. Now when changes are required to Rust's syntax they're just a cargo fix away from being resolved.

1.34 — Alternative Crate Registries As Rust is used more and more in production, there is a greater need to be able to host and use your projects in non-public spaces, while cargo has always allowed remote git dependencies, with Alternative Registries your organisation can easily build and share your own registry of crates that can be used in your projects like they were on crates.io.

1.39 — Async/Await The stabilisation of the async/await keywords for handling Futures was one of the major milestones to making async programming in Rust a first class citizen. Even just six months after its release the async programming has blossomed into a diverse and performant ecosystem.

Error Diagnostics

One thing that we haven't mentioned much is how much Rust's error messages and diagnostics have improved since 1.0. But they have improved so much over these past five years, looking at older error messages feels like looking a different language.