Today, we’re excited to release the alpha version of Rust 1.0, a systems programming language with a focus on safety, performance and concurrency.
This release marks a huge milestone for Rust and its community:
The language is feature-complete for 1.0. While we plan to make many usability improvements before the final release, all 1.0 language features are now in place and we do not expect major breaking changes to them.
The core libraries are feature-complete for 1.0. API conventions have been firmly established, and core functionality – basic types, traits, data structures and concurrency primitives – has all been stabilized. Here again we do not expect major breaking changes before 1.0.
The Rust community really rolled up their sleeves to help push this release over the finish line; thanks to everyone who participated, and especially to the friends of the tree!
While we’ve come a long way in the last four months, there’s a lot left to do before Rust hits 1.0 final. Read on for more.
What happens during the alpha cycle?
If you’re already a Rust user, the first thing you’ll notice during the alpha cycle is a dramatic drop in the pace of breaking changes.
Most features and modules that will ship with Rust 1.0 are in place and will change in only limited ways during this cycle, as detailed later in this post. Only a few modules – the key ones being path manipulation and I/O – are still stabilizing.
We need your help to iterate on those final libraries before the beta release, and to hammer out any remaining issues on the parts of Rust we have already marked as stable. During the alpha cycle, we recommend using the nightly releases, which will continue to evolve as these APIs take their final shape.
The alpha release is part of our transition into stability guarantees. While we’re not ready to make full stability guarantees yet, this release cycle moves us much closer to that 1.0 goal. When 1.0-beta1 is released six weeks from now, these important remaining APIs will be stable. Code that compiles on the beta release should do so with minimal changes on 1.0 final as well.
What’s shipping in alpha?
Dynamically-sized types (DSTs): Types whose size is only known at runtime (such as array slices and trait objects) are now largely integrated into the language, including basic integration with user-defined smart pointers. Implemented by Nick Cameron; rolled out by Jorge Aparicio.
Multidispatch traits: Trait implementations can now be selected via multiple types (not just
Self), which has opened the door to many interesting APIs. Implemented by Niko Matsakis; rolled out by Jorge Aparicio and Aaron Turon.
Associated types: Traits can now have associated types, which cuts down on verbosity with generics and aids type inference. Implemented by Patrick Walton, Niko Matsakis, and Nick Cameron; rolled out by Jorge Aparicio.
Where clauses: A powerful new way of specifying trait bounds, where clauses have landed and enabled some significant simplifications in the standard library. Implemented by Niko Matsakis, Patrick Walton, and Jared Roesch; rolled out by Jorge Aparicio and Aaron Turon.
“Unboxed” closures: Closures are now just another way of using the trait system, which required adding higher-ranked lifetimes; this allows much greater flexibility for both ownership and choosing static or dynamic dispatch. Implemented by Patrick Walton, Brian Koropoff and Niko Matsakis; rolled out by Jorge Aparicio.
macro_rulessystem has been significantly revised, cleaning up a number of rough edges and future-proofing in various ways. While macros suffer from some significant deficiencies, the macro system is a powerful and important part of Rust programming that will ship with 1.0. We plan to build a second-generation macro system after the 1.0 release. Implemented by Keegan McAllister and Corey Richardson.
Integer type changes: The long-running debate about integer types was recently resolved:
uintare now known as
usize, and no longer suggest the role of “default integer” in Rust. Credit goes to the entire community for the vigorous debate.
Opt-in builtin traits: The marker traits that Rust uses to classify data as copyable, thread-safe, and so forth have been significantly refactored to have safer, more predicable defaults. Implemented by Patrick Walton and Flavio Percoco Premoli.
All of these language features have been rolled out throughout the standard library.
Consistent conventions: A large number of conventions RFCs have been approved, and are largely summarized in the Rust Guidelines; these conventions have been rolled out through all
std. Led by Aaron Turon.
Stable core types and traits: All of the primitive types and basic building blocks (like
RefCelland so on) are now
#[stable]. Stabilized by Aaron Turon, Alex Crichton, Brian Anderson, Brendan Zabarauskas and Huon Wilson.
Iterators and collections: A series of RFCs have been implemented to revamp and stabilize the collections APIs; iterators are also
#[stable]. RFCs by Aaron Turon and Alexis Beingessner, stabilized together with Chase Southwood, Piotr Czarnecki, Félix Raimundo, Clark Gaebel and others.
Concurrency primitives: Rust’s concurrency modules have seen an overhaul, including thread-local storage, synchronization primitives, and a new thread API that will soon allow child threads to share data on their parent’s stack. These APIs are more efficient and idiomatic than previous versions, and most are already
#[stable]. Implemented by Alex Crichton and Aaron Turon.
Runtime freedom: Rust’s runtime system and green-threading model has been entirely removed, which cut the static binary size of “hello world” in half and has opened the door to lower-level hooks into the standard library. Implemented by Aaron Turon.
The Rust Programming Language: The previous split between “The Guide” and “The guides” has been rectified by combining them into “The book”. Led by Steve Klabnik.
Rust by Example: The lovely http://rustbyexample.com/ introduction to Rust is now part of the official documentation. Initiated by Jorge Aparicio.
Additional API documentation: A lot of work has gone into improving API documentation, both by expanding the overview text and adding examples throughout. Credit goes to the the entire community, who worked tirelessly to improve these docs.
What remains to be done?
A detailed list of possible breaking changes to stable features/APIs can be found here. Below is a list of major areas of improvement for the alpha cycle:
Improvements to associated types and unboxed closures: Both of these features are functional, but we plan to make significant ergonomic improvements during the beta cycle, such as more sophisticated capture-clause inference and more uniform support for shorthands like
Improvements to generics: We will explore avenues to cut down on the number of redundant trait bounds that are currently required.
Path reform: The
pathmodule will soon be reformed to make use of DST, to give a better account of platform differences, and to more closely align with the new C++ standard. Implementation work is largely complete, and the rollout should occur soon after alpha.
IO reform: An overhaul of the IO APIs is being planned; please join in the conversation! These changes will be landing throughout the alpha cycle.
Sync/Send changes: We plan to tweak the definitions of the
Sendmarkers so that threads can share stack data. This may cause some minor breakage.
Integer type auditing: During the alpha cycle, we will finalize formal conventions for choosing integer types and re-audit the use of these types in
std. This auditing may cause some breakage to
Documentation for all features: Some recent feature additions, such as associated types and unboxed closures, have their RFC as the only documentation. User-facing documentation for these features will be added during the alpha cycle. The reference will likewise be brought up to date and improved.
Complete API documentation: Everything marked stable will have at least a usage example, and hopefully complete textual explanation, before beta.
And, of course, we will continue to fix bugs and add polish throughout the alpha cycle.
Contributors to Rust 1.0.0-alpha
This alpha release could not have happened without the help of Rust’s enthusiastic community. Thanks go to:
Brian J Brennan
Cody P Schafer
Earl St Sauver
Felix S. Klock II
John Kåre Alsaker
Joseph Rushton Wakeling
Rolf van de Krol
Ruud van Asseldonk
Sean T Allen
Victor van den Elzen