MaiaCpp (WebCpp) is a C++98 to C transpiler that translates a restricted subset of C++98 to C code, which can then be further compiled to WebAssembly via the MaiaC toolchain. Current stable version is 1.3.3. The project includes a CLI wrapper (webcpp.sh) and supports generating AST (XML, JSON, tree), C output, JS wrapper, WAT, and WASM. It integrates with MaiaC for WebAssembly generation and provides Node.js and browser runners. Differentiators: focuses on a minimal C++98 subset suitable for embedded or WebAssembly use cases, with a migration guide from legacy runner scripts to a dist-oriented flow.
npm install maiacppNo compatibility data collected yet for this library.
Basic usage of maiaCpp: transpile a C++98 file to C, then generate WASM, and create a distributable package.
Update your scripts: add '--mode legacy' to maintain old behavior, or migrate to dist mode.
Use run-test-cpp.sh --target all or webcpp.sh for new workflows.
Refer to test files and documentation for supported features. Avoid using unsupported constructs.
Ensure MaiaC is available in the environment when generating WAT or WASM.
If JS output is needed, ensure the MaiaC toolchain is properly installed and webcpp.sh forwards the --js-out flag.
Install MaiaC from its repository (https://github.com/souzamonteiro/maiac) and ensure webc is accessible.
Simplify code to C++98 subset; avoid templates, exceptions (except try/catch limited), RTTI, etc.
Create the directory or use --out-dir to specify an existing path.
Use --file <path> to specify the input C++ file.
No dependency data recorded yet.