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.
What's cooking on master?
71 pull requests were merged in the last week.
Breaking Changes
- libgetopts has had some public re-exports removed, Fail_ renamed to Fail, and getopts::FailType has been removed.
- BinarySearchResult's variants are no longer re-exported, and must be accessed through the enum itself.
- libsync is dead. Long live
std::sync
andstd::comm
. All uses of libsync should be able to cleanly migrate to these two modules. - MaybeOwned[Vector] has been deprecated in favour of Cow. See the PR for full details of all the consequences.
- Non-failing
unwrap
methods have been renamed tointo_inner
, as per RFC 430 - You can no longer invoke Dark Magicks and match on an enum struct variant as if it were a tuple. As a consequence, Rust is no longer a useful programming language.
- non-ASCII lifetime identifiers have been feature-gated. Rust is now only of academic interest, and lacks any practical applications.
Other Changes
- Unboxed closure captures are now available in debuginfo.
- tomjakubowski has taught Rustdoc about several of rust's new features.
- Some missing collection iterators have been added.
- The inner contents of Buffered io types are now accessible mutably.
- Tests now add less useless whitespace to your terminal's output.
- Statically allocated TLS keys are now explicitly leaked.
- Fields of consts are now transitevly interpreted as const,
allowing e.g.
[T, ..MY_TUPLE.0]
. ::::
no longer appears in module paths in debug logs.- AtomicOption now correctly requires
Send
for memory safety. - japaric has DST-ified more of the standard libs
- The iterator module has been partially stabalized.
- Platform-specific io modules
std::os::unix
andstd::os::windows
have been added for working with lower-levelio
details like file descriptors, SOCKETS, HANDLES, etc. - Slice iterators can now be converted to slices via
as_slice
. - Rng now supports
next_f64
andnext_f32
.
New Contributors
- Ben S
- olivren
- Pascal Hertleif
- Roy Crihfield
- Ulysse Carion
Approved RFC's
- Disallow type/lifetime parameter shadowing: Rarely what you want, confusing when it happens.
- Add "function name macro": This RFC proposes the addition of a function! macro that expands to the function it's used in. This will greatly help error reporting.
- extension trait conventions: This is a conventions RFC establishing a definition and naming convention for extension traits:
FooExt
.
New RFC's
- Stabilize
std::{c_str, c_vec}
: Stabilize the std::{c_str, c_vec} modules by re-working their interfaces and refocusing each primitive for one particular task. - Error Reform and Failure Box: This RFC proposes changes to the
Error
trait and the introduction of aFailure<T>
wrapper type for errors and modifications to theError
trait for better error interoperability and debugging support. Reddit - Remove the
[]
notation for taking a whole slice: &* has emerged as less strange and more idomatic - Change DST syntax to
T: Sized?
: Change the syntax for dynamically sized type parameters fromSized? T
toT: Sized?
, and change the syntax for traits for dynamically sized types totrait Foo: Sized?
. Extend this new syntax to work withwhere
clauses. - rename
lifetime
tolifespan
: 'nuff said - std::ascii reform: Move the
std::ascii::Ascii
type and related traits to a new Cargo package on crates.io, and instead expose its functionality foru8
,[u8]
,char
, andstr
types. Reddit - Make brackets optional for single attributes: This is an alternative to #483: instead of changing attributes to
@
, just make the brackets optional for#
. - Change attribute syntax to @foo: Change attribute syntax from
#[foo]
and#![foo]
to@foo
and@!foo
. Reddit
Community
From the Team
- Weekly-meetings/2014-11-25: extension trait conventions; shadowed lifetimes; problems with unused type params; es6-style string escaping; int fallback redux redux Reddit.
Blog Posts
- Rust borrow and lifetimes: Another survey of how borrows and ownership works in Rust. Reddit
- Rust, Generics, and Collections: A look at some of the space of generic programming in Rust, and how it interacts with collections.
- Rust compiling rust: adventures with librustc: A quick look at using librustc programmatically. Reddit
- Interoperating Between Objective-C and Rust: How to write FFI code for Objective-C Reddit
- Purging Proc: Niko explains the present and future of unboxed closures. Reddit
- Installing Rust nightly builds into your home directory: A simple guide for setting up Rust in your terminal on a Mac. Reddit
- Procedural Generation in Rust Part 1: Setting up your Environment: Setting up Rust in Windows. (this week's author of TWiR can testify that this is sometimes harrowing) Reddit
- Benchmarking is Confusing in Low Level Rust: A dive into trying to re-implement Reader and Writer performantly, and determining if you've actually done that. Reddit
Discussions
- which classes of errors remain with rust?
- The Sad State of Zero-on-Drop Reddit
- Are there any Rust books in the pipeline?
- Crates.io Package Groups Proposal
- Are there plans for a Rust runtime?
New Projects
- pitch_calc: A library for musical pitch conversions! Provides functions and traits for converting between frequency, midi-step and letter-octave.
- irc: An IRC library for Rust.
- SoundStream: A simple-as-possible, fast audio I/O stream for Rust
- capture.rs: A macro for explicit capture clauses
- morphism.rs: A structure for suspended closure composition
- collect-rs: An experimental extension of the Rust standard library's libcollections
- confsolve: Command line tool for resolving Dropbox/Wuala conflicts
- enum_ns: A simple compiler plugin to enable the old enum namespacing behavior for select modules and crates
- Multipart + Hyper: An extension to Hyper that provides client- and server-side support for HTTP multipart/form-data requests
- sersve: A directory server in Rust with Iron
Project Updates
- [This Week In Servo 13]
Upcoming Meetups
- Rust Berlin Hack and Learn: December 9th
- Rust Amsterdam: Early 2015