GUADEC 2018 - Federico Mena Quintero - Patterns of refactoring C to Rust
Channel: GUADEC
Date: 04/08/2018

Last year I gave a talk on *why* it was desirable to port librsvg from C to Rust.  That talk showed cool things about the Rust language, mostly centered around expresiveness and memory safety.

This time, I want to show you *how* the librsvg team (we have a team now!) has been doing the port, gradually, steadily, without breaking client applications.  We will present common patterns that show up when refactoring C to make it easy to port to Rust.  We'll show how the first pass at Rustification works, but it is ugly - but how a second pass can turn it into beautiful, idiomatic Rust code.  We'll show how C code with no error handling can be turned into Rust code that checks and propagates errors thoroughly.

The hope is to show that we can give the low-level GNOME platform another 20 years of life by porting it to a better low-level language.

CC BY-SA 4.0