The SCPP Programming Language
Common Programming Concepts
Understanding Ownership
Using Structs and Classes to Structure Related Data
Safety Boundaries and
[[scpp::unsafe]]Packages, Modules, and Project Layout
- Packages and Project Manifests
- Control Scope and Privacy with Modules
- Paths for Referring to Items in the Module Tree
- Using
importand Qualified Names - Separating Modules into Different Files
Arrays, Buffers, and Views
- Fixed-Size Arrays
- Text as
charand C-Compatible Buffers - Borrowed Views with
std::span
Error Handling
- Unrecoverable Errors and Compiler-Inserted Checks
- Recoverable Errors Today
- Preparing for
std::expected
Generic Code, Concepts, and Lifetimes
- Generic Data Types
- Defining Shared Requirements with Concepts
- Validating References with Lifetimes
Writing Automated Tests
- Compile-and-Run Tests
- Controlling Test Commands
- Test Organization
An I/O Project: Building a Command-Line Program
- Accepting Command-Line Arguments
- Reading a File
- Refactoring into Modules
- Adding Functionality with Tests
- Working with Environment Variables
- Writing Diagnostics to Standard Error
Closures and Explicit Iteration
- Closures
- Processing Sequences with Loops and Views
- Improving Our Command-Line Project
- Performance of Explicit Loops
More about Project Builds and Reusable Packages
- Compiler and Project Build Modes
- Building Reusable Module Artifacts
- Workspaces
- Installing and Running Binaries
- Extending the Tooling
Smart Pointers and Owned Handles
- Using
std::unique_ptr<T> - Treating Owning Pointers Like References
- Running Cleanup Code with Destructors
std::shared_ptr<T>- Interior Mutability with
mutable - Avoiding Reference Cycles and Ownership Confusion
- Using
Fearless Concurrency
- Using Threads to Run Code Simultaneously
- Moving Data Across Thread Boundaries Safely
- Shared-State Concurrency
- Thread Traits:
thread_movableandthread_shareable
Interoperability and Fixed-Layout Data
- Fixed-Layout
structValues - C ABI Boundaries
- Packed Layouts and
unionEscape Hatches
- Fixed-Layout
Advanced Features
- Advanced Concepts and Constraints
- Advanced Types and Function Pointers
- Advanced Functions and Closures
- Metaprogramming Without Macros
Final Project: Building a Multithreaded Web Server
- Building a Single-Threaded Web Server
- From Single-Threaded to Multithreaded
- Graceful Shutdown and Cleanup
Appendix
- A - Attributes and Reserved Spellings
- B - Operators and Symbols
- C - Standard Library Building Blocks
- D - Useful Development Tools
- E - SCPP26 and the C++26 Baseline
- F - Translations of the Book