Rust’s match statement can do a lot of things, even C-style fallthough to the next branch, despite having no real support for it. It turns out to be a “shallow” feature, where the C to Rust translation is easily done, without needing to und...
The primitive integer types supported by CPUs are finite approximations to the infinite set of integers we’re all used to. This approximation breaks down and some computations will give results that don’t match real integers, like 255_u8 +...
Memory unsafety and memory leaks are arguably the two categories of bugs that have received the most attention for prevention and mitigation. As their names suggest, they are in the same part of “bug space”, however they are in some ways di...
Imagine being able to step forward and backwards as code runs in your debugger. Imagine being able to do an test run multiple times with exactly the same sequence of instructions and values, right down to memory addresses and IO. Imagine be...
I recently released version 0.3 of my simple_parallel crate, which builds on Aaron Turon’s crossbeam to resolve the stability and safety difficulties: the crate now works with Rust 1.3.0 stable, and offers safe data-parallel for loops and m...
A new scheme for SIMD in Rust is available in the latest nightly compilers, fresh off the builders (get it while it’s hot!). For the last two months, I’ve been interning at Mozilla Research, working on improving the state of SIMD parallelis...
Rust has some powerful tricks to model properties of aggregate types via unsafe traits with default and negative implementations. These features motivated by offering flexible concurrency/parallelism, and allow powerful closure-based APIs w...
The concept of object safety in Rust was recently refined to be more flexible in an important way: the checks can be disabled for specific methods by using where clauses to restrict them to only work when Self: Sized. This post is a rather...
Have you ever used an iterator adapter in Rust? Called a method on Option? Spawned a thread? You’ve almost certainly used a closure. The design in Rust may seem a little complicated, but it slides right into Rust’s normal ownership model so...
After announcing travis-cargo a few days ago in Helping Travis catch the rustc train, I got some great hints/contributions from Jan Segre and had a fun little time automating code coverage collection via coveralls.io. Unfortunately, this is...
I’ve been putting off configuring my continuous integration settings to match the Rust train model: it involves non-trivial branching on the configuration, and duplicating that over a pile of repos is not something I looked forward to. So,...
Rust is a reasonably large project: the compiler and standard libraries are over 350kloc, built across nearly 40000 commits by the hands of around 900 contributors. Not only that: there are more than 30 other repositories in the rust-lang G...
A trait object in Rust0 can only be constructed out of traits that satisfy certain restrictions, which are collectively called “object safety”. This object safety can appear to be a needless restriction at first, I’ll try to give a deeper u...
An important piece in my story about trait objects in Rust0 is the Sized trait, so I’m slotting in this short post between my discussion of low-level details and the post on “object safety”. Other posts in this series on trait objects Peeki...
One of the most powerful parts of the Rust programming language0 is the trait system. They form the basis of the generic system and polymorphic functions and types. There’s an interesting use of traits, as so-called “trait objects”, that al...
Sorry, I couldn’t find that. Home, all posts. Similar? Error handling in Rust: a k-NN case studyComparing k-NN in RustFinding Closure in RustPeeking inside Trait ObjectsWhere Self Meets Sized: Revisiting Object Safety
Sorry, I couldn’t find that. Home, all posts. Similar? SIMD in RustError handling in Rust: a k-NN case studyComparing k-NN in RustWhat does Rust's “unsafe” mean?Announcing Primal: Putting Raw Power Into Prime Numbers
Memory profiles Memory profiles of the stage2 rustc when building librustc (on Linux x86-64). Data provided by cmr. (Old data archived). This shows the last 400 merges into master. Source.