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?
66 pull requests were merged this week.
Breaking Changes
- Some more string methods now return Option.
- Matching on
~str
has been removed. - IO iterators now yield IoResult.
- The channel types and constructor have been
renamed.
Chan
is nowSender
,Port
is nowReceiver
, andChan::new
is nowstd::comm::channel
. std::cmp::{min, max}
now require TotalOrd. For floats, usea.min(b)
.- The handling of
cfg(not(a, b))
has changed slightly. libextra
has finally been purged.
Other Changes
- Another great PR from the illustrious ktt3ja, the compiler will now give suggestions on how to fix lifetime woes. This is an awesome usability improvement.
- Implementations of
Deref
andDerefMut
are now considered for automatic dereferencing. - Partial type hints are now
implemented, but not at the item
level (in function returns etc). The eventual goal is to have
some_iter.collect::<Vec<_>>()
be possible. - There is a new guide for "low level and unsafe code". PR.
- There is now a lint for uses of
~[T]
. It's very verbose. The replacement for~[T]
, as recommended by the lint, isstd::vec_ng::Vec<T>
. It implements almost everything~[T]
does. HashMap
has been reimplemented to use Robin Hood hashing. It's now much more faster, and uses less space.- Support for basic backtracing has been reimplemented.
char
now has simple case folding. That is, basic locale-ignorant case conversion.- Inline assembly now supports the
+
modifier.
New Contributors
- Adolfo Ochagavía
- Clark Gaebel
- Peter Marheine
- Piotr Czarnecki
- Piotr Zolnierek
- Robert Gawdzik
Weekly Meeting
The weekly
meeting
discussed the new hashmap, destructuring the self
argument, partial type
hints, coercion of returned values, as well as the requirements of unsafe
pointers and the continued existence of *mut
.
This Week in Servo
Servo is a web browser engine written in Rust and is one of the primary test cases for the Rust language.
In the last two weeks, we landed 56 PRs.
Notable additions
- Patrick Walton made fixes to ACID in #1905
- Along with about 20 other PRs, ms2ger brought WindowTimers up to date with the spec in #1890
- Pradeep Kumar implemented
position:absolute
in #1681 and fixed up relative positioning in #1808 - Bill Yang fixed up our instructions for installation on Ubuntu Linux in #1881
- Bruno Abinader fixed up HTMLCollection in #1838
- Isabelle Carter ensured that children of
position:fixed
items make it into the correct DisplayList in #1832 - Manish Goregaokar made
getElementsByName
return aNodeList
in #1756 - Keegan McAllister cleaned up our reftest harness and made them test both the CPU and GPU rendering paths in #1804
New contributors
- Bill Yang (analyst74)
- Manish Goregaokar (manishearth)
Meetings and Notes
At this week's meeting, we discussed HTML parsing, embedding, writing modes, the ACID2 burndown, and the Rust upgrade.
RFCs
We have a new RFC process! Every week I'll list the new RFCs and RFCs that have been accepted. Contributing to the discussions around these RFCs is the easiest way to drive the design of Rust.
As an aside, I will no longer include any RFCs in the "Announcements" section that are not sent to the RFC repository.
- Private Fields by Default
- Rearchitecting the attribute-usage lint
- Unified Function Call Syntax
- Virtual Structs
- Add OsUnknown as a target operating system
- Redesign Compiler Intrinsics
- "Fat Objects" for DSTs, an alternative to "Virtual Structs".
Project Updates
rust-bencode, a pure Rust
implementation of Bencode encoding.
Bencode is used primarily in the
BitTorrent protocol. This implementation leverages the serialize
crate for
automatic Encodable/Decodable implementation as well as custom, more flexible
FromBencode/ToBencode traits.
Lazily initialized statics v0.2. This makes safe use of statics for types which require runtime initialization almost trivial. It utilizes the recent overloadable deref to do optional initialization before returning the reference to the wrapped type. It's an example that the right amount of abstractions, but syntactic (macros) and semantic (operator overloading) can reduce boilerplate for a more pleasant experience.
Racer - code completion for Rust. This project is in its early stages, but can already do a fair bit of useful completion. It is not using the parser (libsyntax) or compiler (librustc), so it will likely always be inaccurate in some respect. Nevertheless, this may prove to be an incredibly useful tool.
QuickCheck for Rust. This has some seriously great docs. QuickCheck, originally from Haskell, is a way of doing property-based testing. You describe certain properties your code should have and it generates random inputs, trying to find inputs that violate those properties. This is a modern, featureful port of QuickCheck and hopefully gets even more useful as time goes on.
The coreutils port is still alive and making progress. 32 out of 119 programs are implemented. This is a great project to contribute to if you want a relatively self-contained, goal-oriented task. It's great practice both for learning Unix* (some of these utilities are quirky or not-frequently-used) and Rust.
* Well, specifically GNU, which as we all know, ain't Unix.