A cable-stayed bridge under construction, with two towers and a gap in the middle where the two halves of the deck have not yet been joined.

All Rust Workshops

Migrating C to Rust

3 days Bookable for teams – on-site or remote Individual tickets available

About this workshop

Migrating C code to Rust is rarely a single “rewrite” step. It’s a process that forces you to weave together these two very different systems. Calling conventions, memory management, tooling, and (most importantly) how you structure and test your code. These things can quickly explode in complexity if misunderstood or incorrectly managed.

We designed this workshop to give your team a coherent path from “I can write Rust” to “I can ship Rust in a C codebase” without hand-waving over these complexities.

We start from the fundamentals of C/Rust interoperability and gradually build up to a pragmatic module rewrite process, touching on performance, testing, debugging, and long-term maintainability.

By the end of the workshop, you will have a clear mental model of Rust’s FFI boundaries, know how to design FFI-friendly APIs, have written plenty of (correct) unsafe code, and have a concrete playbook to migrate real modules with confidence.

The workshop is designed for software developers working in or around C/C++ codebases. Familiarity with Rust basics is helpful, but we’ll introduce the concepts you need as we go.

Bookable for teams

3 days

On-site or remote

Book for your team

Individual tickets

1.200,00 €

Syllabus

  1. The basics

    We will cover the essentials of FFI-safe Rust: extern "C", ABI considerations, #[no_mangle], and when to use repr(C).
  2. Building and Linking

    We will look at how Rust links C code in practice: the -sys crate pattern, using build.rs, integrating with existing build systems, and generating bindings with bindgen — followed by how to build safe abstractions on top of unsafe bindings.
  3. Idiomatic FFI

    We will translate common C idioms into idiomatic Rust: iterators instead of manual loops, return values vs out-parameters, vtables vs traits (and when to keep the C shape), strings and encodings (CStr vs str), return codes vs errors, as well as bitflags.
  4. Testing, Benchmarks, and Sanitizers

    Testing, benchmarks, sanitizers, and more. We will put our FFI code on solid foundations. We will learn how to effectively use tools like Valgrind, sanitizers, and Miri. We will discover their limitations and when to reach for which tool.

Your mentor

Luca Palmieri

Principal Engineering Consultant

Luca Palmieri builds technology products for a living. His current focus is on backend development, software architecture and the Rust programming language. He is the author of "Zero to Production in Rust".

Our Attendees Say...

Very good format.
Remote attendee
Very good, the balance of practical work mixed with bite size new concepts works nicely
Onsite attendee

Who we are

Mainmatter has been active in the Rust ecosystem for years, creating the 100 Exercises to Learn Rust course, the C to Rust Migration Book organizing EuroRust, and contributing to open source.

We help teams adopt and build on Rust with confidence via trainings and workshops, hands-on team reinforcement, codebase assessments, and more.

We have trained developers at

Bookable for teams

3 days

On-site or remote

Book for your team

Individual tickets

1.200,00 €

Can't Find the Right Workshops for Your Team?

We are happy to tailor the curriculum to your needs. We can combine multiple workshops, pick and choose modules, as well as develop new content if desired.
Get in Touch

Book This Workshop

Our mentors look forward to working with your team and unlocking new capabilities.

Send us a message

Your message is being sent…

Unable to send message.

Please try again later or contact us at [email protected]

Thank you!

We will be in touch soon.

Migrating C to Rust