»Schedule // Workshop
Wednesday, October 14, 2026
10:00–16:00
Location: WeWork Glories Barcelona, Carrer Tànger 86 Barcelona, B 08018

C→Rust, Beyond the Basics

About

Rewriting a C codebase in Rust isn’t a big bang: it’s a marathon, where you execute a series of small, deliberate steps. This workshop teaches you how to do it incrementally, based on hard-won lessons from migrating production C codebases over to Rust.

We’ll start with FFI fundamentals (repr(C), bindgen, cbindgen), move to writing correct extern “C” interfaces, then work through a 4-step module rewrite process: encapsulate, rewrite, bridge, swap. Along the way, we’ll cover the pitfalls (mixed allocators, string encoding, performance overhead) and some of the high-level strategies you can use when planning out a large-scale migration. There will be hands-on exercises at each stage.

Description

At the end of the workshop, participants will be able to:

  • Set up bidirectional C/Rust FFI with appropriate tooling (bindgen, cbindgen)
  • Write correct and ergonomic extern “C” functions
  • Apply a systematic process to rewrite a C module in Rust
  • Avoid common interoperability pitfalls

Prerequisites

Participants are expected to bring a laptop to work on hands-on exercises. You’ll receive instructions via email, ahead of the workshop, detailing what software has to be installed beforehand.

Arrow pointing from C to Rust
Mentor

Magnus Markling

Magnus has been building software professionally since 2006. He has written production code in more than ten languages and Rust is the one he finds most rewarding. For many years he was lead architect of minPension.se, a Swedish pension portal with 3.8 million users, taking it from a small Visual Basic application to a modern distributed system.

Today he's an independent contractor working with Mainmatter. He is helping migrate the search engine of a widely used open-source data platform from C to Rust, one module at a time. His day-to-day involves the parts of a migration that decide whether it succeeds: FFI boundaries, core data structures like tries, and Unicode validation and conversion.

He is based in Gothenburg, Sweden. Outside of code, he sings in choral ensembles, plays Swedish and Irish folk music on mandolin and tin whistle, and can be found on the padel court.