C+

About

Why C+ exists

C+ is a compiled, statically typed systems programming language: native machine code through LLVM, no VM, no garbage collector, manual memory made safe by a borrow checker, and two-way C ABI compatibility.

The premise

Systems languages have historically optimized for terse authoring and deep feature sets: implicit conversions, operator and function overloading, macros, closures, and reference types with complex lifetime notation. Over time, that surface makes code harder to read in isolation.

C+ is built for reading and verifying. Every program stays locally legible: you can read one function and know what it does, what it owns, what it mutates, and where it can fail, without chasing hidden control flow across the codebase. That clarity matters whether a function was written by a teammate or generated by a model.

Toolchain and introspection

The cpc compiler exposes its own resolved view of a project rather than keeping it locked inside the build step.

Editors, scripts, and coding agents can query the compiler's typed symbol graph through cpc query, cpc lsp, and cpc mcp, validate changes cheaply with cpc check --diagnostics=json, build native binaries with cpc build, and inspect or drive running Facet applications through capability-granted UI surfaces.

What we left out, on purpose

Every feature C+ omits removes a class of hidden control flow or ambiguity, while keeping application code concise:

  • No null, so there are no null dereferences to debug. Optional values use Option[T].
  • No exceptions, so control flow is the code you can see. Errors are values, matched explicitly or unpacked with guard let.
  • No closures, so there are no hidden captures or heap allocations; UI and event callbacks use bound methods (this.method) or explicit (fn_ptr, user_data: *u8) pairs.
  • No overloading, so one name resolves to exactly one signature.
  • No implicit conversions, so every width change is visible in the source via as or checked as?.
  • No hidden allocations, so a hot path that must not touch the heap can be proven not to.

A bare parameter is a read-only borrow by default; only in-place mutation (ref) and ownership transfer (take) are marked in the signature. Declarative trees use contextual builder blocks (@ui { ... }) rather than macros. Every operation that can cause undefined behavior is visible in the source itself, and imports name their source.

Safety without a tax on speed

C+ compiles directly to native code through LLVM. There is no garbage collector and no runtime overhead. The borrow checker enforces aliasing-xor-mutation, so data races do not compile, and the same guarantees it proves are the aliasing facts the optimizer needs to vectorize hot loops. Safety and speed come from the same analysis rather than fighting each other.

When a function must be deterministic, you mark it #[realtime] and the compiler proves across the entire call graph that it never allocates, never blocks, and never recurses unbounded. That is a compile error if violated, not a lint you can ignore.

It meets the code you already have

C+ speaks the C ABI in both directions. It calls C directly through extern fn and Objective-C through typed #msg_send and #selector intrinsics, while cpc-bindgen generates C+ packages from C, Objective-C, Swift, Java/JNI, and GObject Introspection interfaces. Because cpc emits standard C-ABI object files and matching C headers, existing C and C++ projects link C+ straight back. You can replace one function at a time inside a CMake build, until the binary stands on its own. Adoption does not require a rewrite.

Where it is today

C+ is pre-1.0 and moving quickly. Version 0.0.30 supports macOS, Windows, Linux, iOS, Android, ESP32, and WebAssembly. The native toolchain runs on macOS, Linux, and Windows. A macOS host cross-compiles for iOS through Xcode; Android and ESP32 use their target toolchains, while cpc-wasm supplies the WebAssembly path. Facet runs through AppKit, UIKit, Android, GTK, and WinUI 3 backends. The language surface is small and stable by design, and the diagnostics are numbered and machine-readable. If you are evaluating it for a team, the adoption guide describes fit and maturity.

Project context, governance, and compatibility

C+ and the cpc toolchain are developed in the open at github.com/netdur/cplus under the MIT License, with design decisions, compiler diagnostics, and release notes tracked directly in versioned commits and release tags.

  • Compatibility expectations: While in 0.0.x, minor point releases may refine standard-library package APIs (for example, the 0.0.30 migration from raw Win32 bindings to winui / facet_winui). Pin a specific cpc release for production or team builds. Every point release preserves its complete language manual snapshot on this site via the sidebar version selector. See Stability & versioning for details.
  • Reporting issues & contributing: Bug reports, diagnostic regressions, and feature proposals are tracked on GitHub Issues. Minimal .cplus reproducers and output from cpc check --diagnostics=json make triage fast.
  • Security disclosures: For vulnerabilities in the compiler, standard library, or capability boundary, follow the Security policy.