Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Rust for C++ Developers
  • Table Of Contents Toc
Rust for C++ Developers

Rust for C++ Developers

By : Dan Olson
close
close
Rust for C++ Developers

Rust for C++ Developers

By: Dan Olson

Overview of this book

If you're a C++ programmer curious about the rising popularity of Rust, this book will guide you through the transition with clarity and purpose. Written by a veteran C++ developer who embraced Rust to improve software quality and maintainability, this hands-on guide shows you how to apply your existing knowledge to build efficient and safe systems with Rust. The first half of the book deep dives into Rust’s history, safety guarantees, and development tooling. From there, the book compares Rust and C++ side by side, covering syntax, SIMD instructions, file I/O, object orientation, and data structures. With each chapter, you’ll gain a practical understanding of Rust’s unique approaches—like ownership and borrowing—and how they solve long-standing challenges in C++. Later half of the book tackles performance optimization, multithreading, macros, and foreign function interfaces, culminating in a complete project where you reimplement a C++ program in Rust. By focusing on real-world code and familiar concepts, this book makes Rust accessible and actionable for experienced C++ developers. By the end of Rust for C++ Developers, you’ll be confident in your ability to read, write, and maintain production-grade Rust code, and you’ll have a clear roadmap for integrating Rust into your future projects.
Table of Contents (20 chapters)
close
close
Lock Free Chapter
1
Part 1: Understanding Rust Basics
6
Part 2: Exploring the Rust Standard Library
12
Part 3: Moving into Advanced Rust
18
Index

How Rust can improve software

For us to choose Rust, it must present a compelling set of features that create a meaningful improvement over the status quo. In this section, we'll examine a few aspects and features of Rust that make it a great choice for reliable and high-performance software.

High level, low level

I'd like to start by sharing one of my favorite examples for Rust beginners: reading a file and producing a hash. Solving this problem in C++ probably begins with an extensive search for an appropriately licensed library that both implements the needed algorithm and happens to be compatible with whatever build system we're using. There are several tools to help with this problem in C++, but none of them are installed by default with every C++ toolset.

I like to use this problem just to show that Rust is easy to use out of the box. Grabbing dependencies is trivial, and a simple program in Rust actually looks simple. Try not to be overwhelmed by...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Rust for C++ Developers
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon