Rust for C++ developers

Slide header

Masterclass on Rust for C++ developers.

Abstract

Correct memory handling and avoiding undefined behavior is required for software to be reliable and secure. In C++, we deal with this by the compiler, experience, best practices, design rules, helper types, static analyzers, etc. However, memory errors are still one of the major sources of bugs in software. One of the main claims to fame for the programming language Rust is that it guarantees memory safety, even in concurrent contexts. This is a bold claim, which comes at the cost of restrictions enforced at compile-time. Still, Rust is very expressive, and in most ways it offers flexibility and performance similar to C++. Another attractive aspect of Rust is its ecosystem: the build system, standard library, tooling and package management. Rust is a relatively young language in the systems development realm, yet it sees a lot of adoption, even in production environments. As engineers, we must use the right tool for the job; perhaps for the next job this tool is Rust. In this presentation, I’m going to show what Rust is about, from the perspective of a C++ developer. Learning another programming language can be tough, but it will advance your programming, even in the languages you already know.

Audience

This session is for professionals in software engineering, level novice to advanced, interested in C++ and Rust.

We will look at Rust by looking through C++ glasses, so a prerequisite is that you know C++ at least at a basic level.

Topic listing

These are the main topics addressed in the talk:

  1. Introduction
  • Why learn Rust?
  • What are the benefits of learning another programming language?
  1. A Rust primer
  • The promises of Rust
  • What is undefined behavior?
  • How the promises are met (borrow checker, lifetime parameters, etc.)
  • Other language highlights
  • The Rust ecosystem (libraries and tooling)
  1. An in-depth look
  • Default language semantics (e.g. move, rebinding references and explicitness)
  • Expressions in Rust
  • Result types: (Option and Result)
  • Error handling
  • Traits
  • Generic programming
  • Concurrent programming
  • Asynchronous programming
  • Unsafe Rust
  1. Where to go from here?
  • Is Rust ready for production?
  • Hints to get started with Rust
  • Pointers to resources and websites