C+ v0.0.12
v0.0.12 is shipped. This release hardens the parts of C+ that have to be exactly right: ownership soundness, the C ABI, and the new real-time contracts. Highlights below; everything here is reflected in the manual.
Ownership soundness
An external read of the manual predicted six places where the ownership rules implied machinery the compiler might not actually enforce. We audited all six against the compiler. Two were live double-free bugs, two were unenforced borrow semantics, and two were by-design and are now documented. The fixes come with four new diagnostics:
- E0509 rejects moving a field out of a
Droptype, where the destructor would otherwise free it a second time. - E0511 and E0512 enforce borrow-region annotations on return types, which were previously inert.
- E0513 rejects returning a
strorT[]view of a function-local that drops at return.
The headline fix is the forward-move case: a bare x: T non-Copy parameter is now lowered as a real move in codegen, so forwarding a value back out of a function frees its heap allocation exactly once. The manual's claim that move x is redundant on a non-Copy parameter is now true all the way down. See Ownership and Drop & defer.
Real-time, checked by the compiler
The real-time roadmap reached a usable milestone. You can mark a hot path and have the compiler prove the property across its entire call graph:
#[no_alloc](E0901) and#[no_block](E0907) now enforce through method dispatch, not just direct calls, and reject string interpolation and unknown externs.#[max_stack(N)](E0908) bounds the estimated stack frame with ABI-accurate sizes.#[realtime]bundles the allocation, blocking, and recursion contracts.- A
[profile.realtime]manifest table applies them across a whole package, socpc checkbecomes a CI gate.
The building blocks ship as packages: rt provides a lock-free SpscRingU64 and a FixedPoolU64, and rt_darwin provides a monotonic clock, audio-QoS thread priority, and page locking. Full detail on the Real-time page.
SIMD lane primitives
The SIMD surface gained the integer-widening lane operations that quantized kernels need: widen and narrow between adjacent lane widths, low / high / combine for half-vector splits and joins, and a runtime-indexed table lookup. Together they make a widening integer dot product expressible without a dedicated builtin. See SIMD types.
A tighter C ABI
Two ABI mismatches that could pass garbage across a C boundary are fixed. An extern fn returning a large aggregate now emits the correct sret shape at both the declaration and every call site, and a struct passed by value into an extern fn is coerced to the platform ABI at the call site. Both are covered by cross-language end-to-end tests. The new jni package is the smallest demonstration that the compiler handles function-pointer struct fields and self-referential pointer types.
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