Introduction
Welcome to the cppbolt documentation.
cppbolt is a dependency-free, correctness-oriented C++ subset compiler written from scratch in Rust. It compiles standard C++17 source code directly into WebAssembly (.wasm) binary format for instant execution in web browsers, Web Workers, Node.js, and headless test runners.
Try the compiler directly online in the Browser Playground.
Book Navigation
- User Guide:
- Getting Started: Installation, command-line usage, and compiling samples.
- Supported C++ Feature Matrix: Complete matrix of supported C++ constructs, test cases, and known limitations.
- Browser Integration: C ABI, Web Worker integration, and JavaScript host environment.
- Diagnostics & Errors: Diagnostic format, source spans, and catalog of emitted errors.
- Compiler Internals:
- Architecture Overview: The five-stage pipeline and direct AST-to-Wasm lowering model.
- Preprocessor, Lexer, Parser & AST, Semantic Analysis, and WASM Codegen.
- Runtime & Standard Library: Memory layout, free-list allocator, and embedded STL headers.
- Testing System: Corpus runner, variant tests, and native compiler oracle gates.
- Architecture Decision Records:
- Architectural, ABI, and language decisions with documented evidence and trade-offs.
- Contributing Guide:
- Building, running tests, code standards, and PR requirements.