Linear Type System
Every value has exactly one owner. Consumed values cannot be reused. Buffer overflows, use-after-free, double-spend — all impossible by construction.
C! is the first programming language designed from the ground up for AI-human collaboration. Linear types eliminate entire vulnerability classes. One codebase deploys everywhere.
// Linear types prevent double-spend fn transfer(token: own Token, to: Address) -> Receipt { ledger.move(token, to) // token consumed } fn bad() { let t = mint_token(); transfer(t, alice); // t consumed transfer(t, bob); // COMPILE ERROR: t already consumed }
Not by discipline. Not by linting. Not by auditing. By the type system itself. If it compiles, these bugs are structurally impossible.
C! brings together ideas that have never existed in a single language before.
Every value has exactly one owner. Consumed values cannot be reused. Buffer overflows, use-after-free, double-spend — all impossible by construction.
Structured intent annotations let any AI understand what code should do. The compiler formally verifies it does. AI writes code, the type system proves it correct.
One codebase compiles to native binaries, WebAssembly, and blockchain bytecode. Frontend, backend, and smart contracts share the same types.
No shared mutable state, no locks, no races. Isolated actors communicate via typed messages with supervision trees for fault tolerance.
Reentrancy is impossible by construction thanks to linear state. Write decentralized applications with the same confidence as traditional software.
The C! compiler is written in C! itself, proving the language is powerful enough for systems-level work. Open source for humans and AI contributors alike.
Explore real C! examples showing how the type system and intent annotations work together.
#[intent("Transfer tokens between accounts, ensuring sender has sufficient balance, atomic — both sides update or neither does")] #[invariant(total_supply_unchanged)] #[pre(balances[from] >= amount)] #[post(balances[to] == old(balances[to]) + amount)] fn transfer( from: Address, to: Address, amount: u256 ) { // Compiler proves this matches // the annotations above }
Write what your code should do in natural language. The compiler formally verifies it does. Any AI can instantly understand any C! codebase.
// Same type used in backend, frontend, // AND smart contract type User { id: UUID, name: String{len: 1..100}, email: Email, role: Admin | Editor | Viewer, }
Define your types once. Use them in your backend API, your frontend UI, and your smart contracts. No code generation, no schema drift, no bugs.
actor WalletService { state balances: Map<Address, u256> on Transfer(from, to, amount) { verify!(balances[from] >= amount); balances[from] -= amount; balances[to] += amount; reply Receipt { tx_id: generate_id() } } }
Each actor owns its state exclusively. No shared memory, no locks, no data races. Communication happens through typed messages with built-in supervision.
fn transfer( token: own Token, to: Address ) -> Receipt { ledger.move(token, to) } fn bad() { let t = mint_token(); transfer(t, alice); transfer(t, bob); // ^ COMPILE ERROR: t already consumed }
Linear types enforce that every resource is used exactly once. Tokens can't be double-spent. File handles can't leak. Memory can't be used after free.
Traditional languages ask developers to avoid mistakes. C! makes mistakes structurally impossible.
Write code, then audit for buffer overflows, race conditions, injection attacks. Hope reviewers catch everything. Ship and pray.
The type system makes these bugs structurally impossible. If it compiles, the vulnerability class is eliminated. No audit needed for what cannot exist.
AI generates code, but humans must review every line for security. AI can't understand intent from code alone. Hallucinations become vulnerabilities.
AI reads structured intent annotations. Generates implementation. Compiler formally verifies correctness. If it compiles, the AI got it right. Trust the math.
C! is open source and welcoming contributors — both human and AI. Join us in building the language that makes secure software the default.