C+ v0.0.13
v0.0.13 is released. The headline is the code knowledge graph: the agent and editor tooling that changes how every future version gets built. Alongside it, the ownership model is completed, the FFI surface is rounded out, and the compiler front end now runs in the browser. It also ships with Homebrew distribution.
The code knowledge graph
cpc already computes resolved names, types, spans, and call reachability on every build, and used to throw them away. v0.0.13 keeps that information and exposes it as a queryable graph, so an agent or editor navigates C+ by symbol and type instead of by text.
cpc graph and the full cpc query surface (def, refs, callers, callees, call-hierarchy, type-at, members, context) are live, resolved, and return JSON with file:line:col locations. They are honest about coverage too: every answer carries an unresolved and scope field. cpc mcp is a resident server that exposes the queries as tools over stdio for agents, keeping the index warm so it actually replaces the grep loop rather than being slower than it.
Two refinements landed with it. The same index now backs cpc lsp, so goto-definition, find-references, hover, and the outline come from one resolved view shared by the editor and an agent. And a call-resolution fix means bare free-function calls and module::fn() path calls now resolve, so callers, callees, and find-references no longer under-report. The only thing left unresolved is a genuine function-pointer indirection, which is the true floor, not a gap.
If you generate or edit C+ with a model, the new guide Navigate C+ by its code graph, not grep is the short version of why this matters.
Raw-pointer accountability is complete
The ownership model now has no silent-leak default. A raw-pointer (*T) field in a Drop type must be accounted for: released in the struct's drop, or marked opaque to say another owner frees it. Anything else is a compile error, E0510, and a release that cannot be proven to always run (a refcount or a flag) is a W0002 warning. The check migrated roughly 95 fields across the vendor packages, which are all clean. See Drop & defer.
FFI and literal polish
A set of small, high-leverage additions that remove real friction at the C boundary:
c"..."C-string literals: a bare*u8to a NUL-terminated blob, safe to form, so FFI code drops the"...\0"plusstr_ptr(...)workaround.f16literal suffix:1.5f16lexes as a half-precision float and lowers with a singlefptrunc, no double rounding.- Struct-literal statics:
static S: T = T { ... };now lowers to an LLVM constant aggregate, with struct-of-struct and array-of-struct composing. - Const-eval array lengths:
[T; N]and[v; N]accept aconstname for the length, so a fixed buffer size lives in one place.
More
#[inline](and#[inline(always)]/#[inline(never)]) attaches the matching LLVM attribute.alwaysinlineinlines hot SIMD wrappers even at-O0and past the cost threshold, where they used to stay a call. See Attributes.cpc --realtime-reportruns the whole project under its[profile.realtime]and prints a digest of every contract violation, grouped by contract, exiting non-zero on any. A clean CI gate. See Tooling.- The compiler front end runs in the browser. A new WebAssembly build compiles lex through LLVM IR codegen to
wasm32, so a single file produces diagnostics and IR entirely client-side. It is the foundation for an in-browser playground. Running a program still needs native linking throughclang, which a browser cannot do, so the browser path is check plus IR.
Get it
brew install netdur/cplus/cplus
cpc --version
C+ is pre-1.0 and moving quickly. If you are evaluating it, the adoption guide is an honest read on fit and maturity.
‹ Back to all posts