-
Book Overview & Buying
-
Table Of Contents
Rust for C++ Developers
By :
We've read that Rust projects use "convention over configuration," but what does this mean? In a C++ project, building requires a list of every individual file that must be compiled and a possibly different set of compile flags, include paths, and preprocessor defines for each one. This leads to configuration overload, and it has spawned several different build systems that attempt to manage the complexity around it in various ways.
In contrast, Rust keeps the build process simple by standardizing around a small amount of configuration and a set of conventions about the structure of the project that allow it to understand how to build each crate. In this section, we'll explore how Rust structures crates and how that structure affects what is built by the compiler.
We've seen in previous chapters that using Cargo to create a new Rust project from the command line is very simple:
$ cargo new...