Hello and welcome to another issue of This Week in Rust! Rust is a systems language pursuing the trifecta: safe, concurrent, and fast. This is a weekly summary of its progress and community. Want something mentioned? Send me an email! Want to get involved? We love contributions.
The big story
This week in Rust was crazy. Rust boldly moved to 1.0 alpha status, and the effort put in to make it happen in the last week was staggering, involving a lot of massive patches, a lot of breakage, and not a lot of sleep. Thanks to everybody for pitching in.
Rust 1.0 is going to arrive very quickly and from now to then the focus is going to be on nestling it into a warm cradle of stability, getting the Cargo ecosystem on the stability bandwagon and making sure the stage is set for all those 1.0 newbies to have a swell ride.
What's cooking on master?
Around 171 pull requests were merged in the last week. It was a long week.
Now you can follow breaking changes as they happen!
- Boxed closures have finally been removed. The pull request includes a detailed description of the impact.
- Unused type parameters on
impls are prohibited. This fixes some soundness holes and generally makes things more sensible. RFC.
uinthave been renamed to
usizeto emphasize that they are not the 'default' integers. The old names are temporarily behind the
int_uintfeature gate to provide a transitionary window. The
uintmodules are now called
- There are new restrictions in the orphan check for impls that ensure that if the implemented trait is not defined in the local crate that the Self type is constrained by local types. Fixes soundness holes revealed by multidispatch. The commit message includes more details.
c_vechave been redesigned. There are no longer any scenerios where Rust frees strings allocated by C, and the APIs are more consistent with modern conventions. Details in the RFC.
trait Foo for Sized?syntax has been obsoleted after a short deprecation period.
Selfis no longer implicitly
- Likewise, the
Sized? Tsyntax for trait bounds has been obsoleted in favor of
- To futureproof for potential alternative designs, chain comparsion
a == b == cmust now be parenthesized. RFC.
FloatMathtrait has merged into
std::threadAPI has changed again.
spawnalways creates a detached thread, and
scopedcreates one which must be joined. The intention is that by requiring a completely different name to create an attached thread it will be harder to accidentally create a deadlock by misunderstanding the join semantics.
target_word_sizecompiler-defined cfg value has been renamed to
- Feature staging has been partially implemented in a series of
patches. Under the current behavior, stability attributes
only mean anything when applied to the crates distributed with Rust
(primarily std), and the 'experimental' stability level has merged
into 'unstable'. Use of unstable APIs is now a warning on the
nightly and beta (alpha) release channels, and a new lint,
unstable_features, that checks for activation of feature gates, is set to warn in betas. RFC.
- The various guides have been merged into a book called 'The Rust Programming Language'.
boxhas been hidden behind the
box_syntaxfeature gate. until it is more fully-baked. For the primary use of constructing boxes, just use
Box::newfor now. /r/rust.
- Syntax for negative impls has been added been
added behind the
optin_builtin_traitsfeature gate. This will let
Sendbe implemented completely in the library eventually. RFC.
- Florian Hahn landed a series of patches to improve the model lexer.
- Cristian Kubis
- Dabo Ross
- Daniel Grunwald
- Dylan Ede
- Guillaume Gomez
- Hyeon Kim
- Jakub Vrána
- John Ericson
- John Kåre Alsaker
- Kelvin Ly
- Kevin Rauwolf
- Laurence Tratt
- Mike English
- Nathan Stoddard
- Peter Schuller
- Raul Gutierrez S
- Sean T Allen
- Thiago Pontes
- Tim Dumol
- York Xiang
- 447: Prohibit unused type parameters in impls. Disallows unconstrained type parameters in trait impls to clean up semantics. PR.
- 494: Stabilize
c_vec. Overhauls these two interop modules for modern tastes. PR.
- 501: Consistent no_prelude attribute. Renames
no_preludeand makes it only apply to the current module. PR.
- 507: Release channels. The post-1.0 release model and the 'feature staging' process by which new features are intrtoduced. PR.
- 526: Statically enforce unicode in
std::fmt. By making
fmtonly deal in unicode some almost-always-redundant sanity checks can be eliminated. PR.
- 544: Rename
- 558: Require parentheses for chained comparisons. Minor
futureproofing that leaves open the option of making
a == b == cbehave more like people expect. PR.
- Macro future proofing. Places restrictions on some
macro_rules!matchers to allow for Rust's grammer to evolve in the future (the implementation has already landed).
- Unchecked downcast methods for
Any. New unsafe methods are added to
Anyfor unchecked downcasting, a small performance and code-bloat-avoidance optimisation in cases where the dynamic type is already known.
- Lifetime parameters for unsafe pointer conversions. APIs for handling lifetimes correctly when dealing with raw pointers.
- Integer overflow. Change the semantics of built-in integer types to be a program error on overflow. Implementations are not required to check for these errors except in debug mode. Adds wrapping int types to the library.
- Remove official
ndebugvariable support. A more rusty solution to turning on debug assertions.
- Relative paths by default. Make paths in
usestatements relative instead of absolute.
- Guidelines for
fmt::String. When to use which of the two format types that convert to strings.
- A byte string concatenation macro. Add a
bytes!macro that produces static expressions of type
&'static [u8]by concatenating the arguments.
- Lose the tick. Remove the tick from some parts of the lifetime syntax.
- Add methods to
Vecwhich can remove multiple elements at once. Ads
Stringto remove multiple elements efficiently.
foo@<T>(x). A different syntax for solving the ambiguity.
#[rustc_*]for future language features. Futureproofing around the lack of namespacing an attributes.
The #rust IRC channel now peaks at more than 900 users.
From the Team
- Announcing Rust 1.0 Alpha. HN. /r/rust. /r/programming.
- weekly-meetings/2015-01-06. fott; 1.0 alpha priorities; LLVM
updates; the fate of
- Peeking inside Trait Objects. Huon explains the runtime representation of Rust's opaque types. /r/rust.
- The Sized trait. Then Huon explains DST. /r/rust.
- Object safety. Then Huon explains the conditions under which a trait may be cast to an object. /r/rust.
- Rust Patterns: Using traits for function overloading. Jonathan Reem demonstrates how to overload functions. /r/rust.
- My experience converting a project from Rust 0.12 to 1.0 (alpha). Looks painful...
- Is now a good time to learn Rust?. A: wait 6-12 weeks. /r/programming.
- Iomrascálaí: A Great Way to Learn Rust or About AI. An AI for the game of Go.
- Notch says something about Rust. Rust is official.
- Rust book by Packt Publishing. There is opportunity to be involved in one of the first Rust books.
- Final decision on builtin integer types. Again. Aftermath.
- Operating system development in Rust. Well-commented hacker news discussion. Nothing new though.
- 151-byte static binary in Rust. Keegan shows that Rust can be small. /r/rust. /r/programming.
- "hello world" contains Lovecraft quotes. /me eyerolls
- Google removes rust, Netflix, other GitHub repos after DMCA takedown. 'Cargo' looks suspiciously like pornography. /r/rust.
- How big a deal is Rust, Really? A: the biggest.
- Pre-RFC: Linear type modifier. Requires certain types to be explicitly disposed.
- Using Rust 1. for video game development?. Some up to date info here.
- multirust. Manage multiple Rust toolchains.
- Roogle. Hoogle 4 Rust.
- Rust for Clojurists. An introduction to Rust. /r/programming.
- Clippy for Rust. A collection of lints. /r/rust.
- rust-blas. Bindings to the immortal BLAS numerical library.
- fallthrough. A macro for fall-through match cases.
- rust-vobject. A vObject/iCalendar parser.
- ProjectEuler. A new attempt at the Project Euler problems.
- forkallcc. Continuations with fork(2)!
- construct. A macro for building arbitrary collections.
- float_macros. CTFE for some float functions.
- This Week in Servo 18.
- Grisu and rust-strconv. Yurume talks about his implementation of the Grisu algorithm for converting floats to strings. This work is likely to make it into std someday.
- Announcing support for 1.0 in Rust Explorer. Shows the assembly of Rust code.
January 12 - Seattle Meetup. January 17 - Beijing Meetup. Presantations about servo and zmq.rs. January 17 - Getting starting contributing to Rust. A special SF Bay area meetup.