Show HN: CeeSafe – Rust-style ownership for kernels, compiled to C11 ceesafe.git...
Show HN @show
Show HN: CeeSafe – Rust-style ownership for kernels, compiled to C11 ceesafe.github.io · 3 points · 0 comments · HN thread
TL;DR CeeSafe is a memory-safe systems language that borrows Rust's ownership and borrowing model but compiles to warning-clean C11 instead of machine code, so the kernel's own C compiler and flags do the final build. The post reports measurements on CosmoOS and a Linux module (ceesafe_mq.ko) and lists the trade-offs: a stricter checker, a trusted C compiler, no soundness proof, and a young ecosystem. The submission has 3 points and no comments yet.
- CeeSafe's compiler ceesafec emits C11 that must compile warning-free under -Werror with strict kernel warning sets, avoiding a second toolchain such as rustc/LLVM alongside the kernel's GCC.
- Struct layouts are never copied; extern "C" blocks name headers and fields, and the C compiler checks each declared field's existence and type at build time.
- Context rules such as no sleeping under a spin lock are checked as inferred effects (sleep, alloc) in the type checker, with errors that follow the call chain.
- Allocation is always explicit and fallible via allocator type parameters; panics abort with no unwinding; integer overflow is checked in every build.
- Reported measurements: nine of nine module checks on x86-64 and AArch64 for CosmoOS, a booted signed module, and a Linux module built with gcc 12.2 and clang 14 with no warnings under make W=1.
- Stated costs: the checker rejects some programs Rust accepts, the C compiler is in the trusted base, there is no soundness proof, and only clang and lld are tested for the kernel profile.
Discussion No comments have been posted yet, so there is no discussion thread to summarize.
#Rust #CeeSafe #kernelSafety #C11 #memorySafety #LinuxKernel