Zen C Modern Ergonomics. Zero Overhead. Pure C. Write like a high-level language, run like C. Overview Zen C is a modern systems programming language that compiles to human-readable GNU C / C11 . It provides a rich feature set including type inference, pattern matching, generics, traits, async/await, and manual memory management with RAII capabilities, all while maintaining 100% C ABI compatibility. Quick Start Installation git clone https://github.com/z-libs/Zen-C.git cd Zen-C make sudo make install Usage # Compile and run zc run hello.zc # Build executable zc build hello.zc -o hello # Interactive Shell zc repl Language Reference 1. Variables and Constants Zen C uses type inference by default. var x = 42; // Inferred as int const PI = 3.14159; // Compile-time constant var explicit: float = 1.0; // Explicit type Mutability By default, variables are mutable. You can enable Immutable by Default mode using a directive. //> immutable-by-default var x = 10; // x = 20; // Error: x is immutable var mut y = 10; y = 20; // OK 2. Primitive Types Type C Equivalent Description int , uint int , unsigned int Platform standard integer I8 .. I128 int8_t .. __int128_t Signed fixed-width integers U8 .. U128 uint8_t .. __uint128_t Unsigned fixed-width integers isize , usize ptrdiff_t , size_t Pointer-sized integers byte uint8_t Alias for U8 F32 , F64 float , double Floating point numbers bool bool true or false char char Single character string char* C-string (null-terminated) U0 , void void Empty type 3. Aggregate Types Arrays Fixed-size arrays with value semantics. var ints: int[5] = {1, 2, 3, 4, 5}; var zeros: [int; 5]; // Zero-initialized Tuples Group multiple values together. var pair = (1, "Hello"); var x = pair.0; var s = pair.1; Structs Data structures with optional bitfields. struct Point { x: int; y: int; } // Struct initialization var p = Point { x: 10, y: 20 }; // Bitfields struct Flags { valid: U8 : 1; mode: U8 : 3; } Enums Tagged unions (Sum types) capable of holding dat...
First seen: 2026-01-12 14:01
Last seen: 2026-01-12 23:03