C+

Install

Install the C+ toolchain

cpc ships as a prebuilt binary, with no Rust toolchain and no compile step. Native builds require clang to assemble and link the final binary. C+ is pre-1.0 and moving quickly; pin a version for any real work. Version 0.0.30 runs on macOS, Linux, and Windows. A macOS host cross-compiles for iOS through Xcode; Android and ESP32 use their target toolchains. WebAssembly uses cpc-wasm.

macOS (Apple Silicon)

Install the prebuilt toolchain with Homebrew:

brew install netdur/cplus/cplus
cpc --version        # cpc 0.0.30

This installs prebuilt cpc, cpc-lsp, and cpc-bindgen with no compile step; update later with brew upgrade cplus. Install the system C toolchain through the Xcode Command Line Tools so cpc build can assemble and link native binaries:

xcode-select --install

Linux (x86-64)

Download and install the .deb package from the v0.0.30 GitHub release (apt install resolves the clang dependency automatically):

curl -LO https://github.com/netdur/cplus/releases/download/v0.0.30/cplus_0.0.30_amd64.deb
sudo apt install ./cplus_0.0.30_amd64.deb
cpc --version        # cpc 0.0.30

The package installs cpc, cpc-lsp, and cpc-bindgen in /usr/bin and the vendor package tree in /usr/share/cplus/packages. On non-Debian distributions, install clang with your package manager, extract the release archive, and add its bin/ directory to PATH.

Windows (x86-64)

Download cplus-x86_64-pc-windows-msvc.zip from the v0.0.30 GitHub release, extract it, and put cpc.exe, cpc-lsp.exe, and cpc-bindgen.exe on your PATH:

Invoke-WebRequest -Uri https://github.com/netdur/cplus/releases/download/v0.0.30/cplus-x86_64-pc-windows-msvc.zip -OutFile cplus.zip
Expand-Archive -Path cplus.zip -DestinationPath C:\cplus -Force
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\cplus\bin", "User")
$env:Path += ";C:\cplus\bin"
cpc --version        # cpc 0.0.30

Native linking on Windows uses clang and the MSVC toolchain (Visual Studio Build Tools / Windows SDK):

winget install LLVM.LLVM

Verify with a first build

Compile and run a single import-free file directly:

printf 'fn main() -> i32 {\n    #println("hello, world");\n    return 0;\n}\n' > hello.cplus
cpc check hello.cplus
cpc hello.cplus -o hello
./hello              # hello, world

Or initialize and build a manifest-backed project:

cpc init hello && cd hello
cpc pm install
cpc check
cpc build
./target/debug/hello

The front-end commands (cpc check, cpc fmt, cpc lsp, cpc mcp, cpc query) need no external tools. Commands that produce or run native code, including cpc build, cpc test, and native object or assembly emission, invoke clang.

Cross-compilation

Once your host build works, you can target mobile, embedded, and browser runtimes:

  • iOS (ios-arm64, ios-arm64-simulator): Built from a macOS host using the SDK supplied by Xcode; emits a static library and C header for the platform shell.
  • Android (android-arm64): Uses the Android NDK toolchain; emits a static library and C header.
  • ESP32 (esp32-xtensa, esp32c3-riscv32): Uses Espressif's esp-clang and ESP-IDF; emits a static library and C header.
  • WebAssembly: Uses cpc-wasm in the browser.

See Targets & cross-compilation for target triples, manifest sections, and linker flags.

Next

Create a multi-file package with Cplus.toml in Getting started, or browse the language manual.