Gabriel Dos Reis
<h1>existing practice and Challenges</h1>
- build time scalability of idiomatic C++
Fragile and Outdated Linking Mode
Program = collection of independently translated source files
Macros are a big problem
Modules accepted for C++20
What did we accomplish
- Languate notions and constructs
- Componentization
- Isolation
- Build throughput
- Semantics-aware developer tools
- With transition paths
- Global module fragments
- Header units
Module Definition (101)
export module BasicPlane.Figures;
export struct X ...
#include <iostream>
import BasicPlane.Figures;
How does it work?
- The generated module generates .o plus metadata
- If name is not exported it is not available
Efficient Pimpl
Spreading Module Definition
- “export module” gives module definition
- “module X” is implementation
Spreading Module Interface
export module BasicPlane.Figures;
export import :PointPart;
export import :RectPart;
export module BasicPlane.Figures:PointPart;
export struct Point {...};
export module BasicPlane.Figures:RectPart;
import :PointPart;
export struct Rectangle {...};
export int width(const Rectangle &); ...
Module Aggregation
export module BasicPlane;
export import BasicPlane.Figures;
export import BasicPlane.Transformations;
export import BasicPlane.Canvas;
Transitioning into modular world, and preparing for modules
module;
#include <sys/stat.h>
export module System.File.Ops;
namespace Sys {
export stat stat_dierctory(const char *);
export using ::chmod;
}
Heder Unit: An almost module
import <iostream>
import BasicPlane.Figures;
Kicking the Tires with MSVC, GCC, and clang
Questions