C-Next is a transpiler (v0.2.16) that compiles a safer C dialect to standard C99 for embedded systems. It aims to follow TypeScript's adoption model: incremental, no new runtime, and readable output for existing toolchains (GCC, Clang, IAR). Key features include type-safe register bindings, automatic bit-indexing, and MISRA-friendly preprocessor compatibility. Unlike Rust or other memory-safe languages, C-Next preserves full use of existing C debuggers, profilers, and optimization passes. Release cadence is frequent (minor updates weekly). Current status: working transpiler verified on Teensy and STM32 hardware.
npm install c-nextNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a register binding and a toggle function, then transpiles to C99.
Update register definitions to include type and access qualifiers: `register NAME @ addr { FIELD: u32 rw @ offset }`.Replace `namespace` with `scope` in all .cnx files.
Replace `=` with `<-` for variable definitions like `u32 LED_BIT <- 3;`.
Update Node.js to >=18.20.0, or use npx which will use the system's default Node version.
Include <stdint.h> or equivalent in your project; C-Next output relies on uint32_t and similar types.
Update Node.js to 18.20.0 or later, or use a version manager like nvm.
Replace `namespace` with `scope` in the .cnx source file.
Ensure register fields have valid types (e.g., u32, u16) and access (rw, wo, ro). Example: `DR: u32 rw @ 0x00`.
Use `<-` instead of `=` for variable bindings: `u32 LED_BIT <- 3;`
No dependency data recorded yet.