Cudo is a programming language where the compiler proves your parallelism is safe, double-spend is a type error, and reentrancy doesn't exist in the grammar. Hand-write it or point your LLM at it — the compiler catches everything either way.
Every Cudo program is a contract. Operations declare what they require, what they touch, and what they emit. The compiler holds you to it.
contract Token<Symbol: copy + drop> { version: 1 contention: per<address> // Alice→Bob doesn't block Carol→Dave state { total_supply: u256, balances: Map<address, u256>, } invariant conservation: // compiler proves this. no SMT. no tests. self.total_supply == self.balances.values().sum() operation transfer(to: address, amount: u256) requires: self.balances[caller] >= amount mutates: self.balances[caller], self.balances[to] emits: Transfer { self.balances[caller] -= amount; self.balances[to] += amount; emit Transfer { from: caller, to, amount }; } }
That's a full token contract. The mutates: clause is enforced —
touch state you didn't declare and the compiler rejects it.
The invariant is proven after every operation, structurally, no solver needed.
Pick a bug. See the exact compiler error. These aren't runtime panics — your code never gets to run.
resource Coin { amount: u256 } operation steal(coin: Coin) { send(coin, alice); send(coin, bob); // use after move }
error[E0301]: resource used after move --> your_code.cudo:5:10 | 4 | send(coin, alice); | ---- moved here 5 | send(coin, bob); | ^^^^ value used after move | = note: Coin is a linear resource and can only be used once
operation oops(payment: Coin) { if is_valid { send(payment, vendor); } // else? payment just... vanishes? // nope. }
error[E0302]: resource not consumed on all paths --> your_code.cudo:1:22 | 1 | operation oops(payment: Coin) { | ^^^^^^^ not consumed | = note: `payment` is dropped when the else branch is taken (line 4) = help: return it, transfer it, or explicitly destroy it
operation sneaky_transfer(to: address, amt: u256) mutates: self.balances[caller] // "forgot" to declare self.balances[to] { self.balances[caller] -= amt; self.balances[to] += amt; // gotcha }
error[E0401]: mutation not in declared set --> your_code.cudo:6:5 | 2 | mutates: self.balances[caller] | -------- declared set ... 6 | self.balances[to] += amt; | ^^^^^^^^^^^ not in mutates clause | = help: add self.balances[to] to the mutates clause
invariant conservation: self.total_supply == self.balances.values().sum() operation free_money(amount: u256) mutates: self.total_supply { self.total_supply += amount; // balances untouched. oops. }
error[E0501]: invariant 'conservation' violated --> your_code.cudo:4:1 | 1 | invariant conservation: | ------------ defined here ... 7 | self.total_supply += amount; | ^^^^^^^^^^ scalar modified without | matching map update | = note: conservation requires self.balances delta == total_supply delta
One binary. Full pipeline — parse, type-check, verify invariants, compile to two ISAs, execute with gas metering. No plugins, no toolchain sprawl.
Parse, type-check, verify linear resources, prove invariants, and analyze parallelism schedule. One command.
Every operation compiles to both stack bytecode and a 256-register ISA. The fast path is automatic — 25-35% fewer instructions.
Run any operation with gas metering, mutation tracking, and event capture. Invariants re-checked post-execution.
Print contract structure: state fields, operations, capabilities, invariants, contention mode. Know what you're deploying.
Output invariant proofs as structured JSON. Pipe them to CI, attach to audits, or feed to external verifiers.
Bootstrap a new contract from built-in scaffolds: token, orderbook, wallet, escrow. Get to the interesting part faster.
Cudo was designed from day one to be written by humans and AI together. Explicit semantics, structured declarations, and a compiler that catches everything means your LLM copilot can ship production contracts — and the compiler will tell it when it's wrong.
Write me a token with per-address parallelism,
a conservation invariant, and freeze capability.
contract Token<Symbol> { contention: per<address> capability Freezer; state { total_supply: u256, balances: Map<address, u256>, frozen: Set<address>, } invariant conservation: self.total_supply == self.balances.values().sum() operation transfer(to: address, amount: u256) requires: !self.frozen.contains(caller) && self.balances[caller] >= amount mutates: self.balances[caller], self.balances[to] { self.balances[caller] -= amount; self.balances[to] += amount; } }
No implicit state, no hidden side effects. Every operation declares its full contract. LLMs don't have to guess what's safe — the structure tells them.
LLM wrote bad code? The compiler rejects it with the exact error and a fix suggestion. Same errors you saw in section 02. No audit needed for the basics.
Drop the language spec into your context window. Your LLM can write valid Cudo in the first prompt. The grammar is small and regular — designed to be learned fast by humans and machines alike.
EVM: global lock. Sui: binary owned/shared. Cudo: you declare the partition key, the scheduler proves non-interference. No speculation, no rollback.
Not toy examples. These ship.
contract CompliantStablecoin<Symbol> { version: 1 contention: per<address> capability Minter; // not a role check — a type constraint capability Freezer; state { total_supply: u256, balances: Map<address, u256>, frozen: Set<address>, } operation transfer(to: address, amount: u256) requires: !self.frozen.contains(caller) && self.balances[caller] >= amount mutates: self.balances[caller], self.balances[to] { self.balances[caller] -= amount; self.balances[to] += amount; } operation mint(to: address, amount: u256) requires: caller has Minter mutates: self.total_supply, self.balances[to] { self.total_supply += amount; self.balances[to] += amount; } operation freeze(account: address) requires: caller has Freezer mutates: self.frozen { self.frozen.insert(account); } }
contract OrderBook { version: 1 contention: per<Pair> // ETH/USDC ‖ BTC/USDC — zero contention struct Pair { base: address, quote: address } enum Side { Bid, Ask } state<Pair> { bids: SortedMap<u256, Vec<Order>>, asks: SortedMap<u256, Vec<Order>>, } resource Receipt { // can't lose it, can't clone it pair: Pair, order_id: u64, side: Side, } operation place_bid(pair: Pair, price: u256, amount: u256) -> Receipt mutates: self[pair].bids { self[pair].bids.insert(price, order); return Receipt { pair, order_id, side: Side::Bid }; } operation cancel(receipt: Receipt) consumes: receipt // receipt destroyed here { destroy receipt; } view best_bid(pair: Pair) -> u256 { self[pair].bids.last_key() } }
contract AAWallet { version: 1 contention: owned // single owner, sequential by nature capability Owner; capability Guardian; struct SessionKey { key: address, expires: u64, spending_limit: u256, spent: u256, } state { owner: address, guardians: Set<address>, session_keys: Map<address, SessionKey>, } operation send(to: address, amount: u256) requires: caller has Owner mutates: self.balance, self.nonce { self.balance -= amount; self.nonce += 1; } operation add_session_key(key: address, limit: u256, duration: u64) requires: caller has Owner mutates: self.session_keys { self.session_keys.insert(key, SessionKey { key, expires: block_timestamp + duration, spending_limit: limit, spent: 0, }); } }
Not mitigated. Not warned about. Killed. These are hard compilation failures.
No callback mechanism in the grammar. Operations can't re-enter. The DAO hack is a syntax error.
no syntax for callbacksLinear resources used exactly once. Using a coin twice is the same class of error as adding a string to an int.
linear type trackingAll arithmetic checked. Overflow aborts. Want wrapping? Opt in with +% -% *%.
The mutates: clause is the law. Touch undeclared state and your program doesn't compile.
Rust toolchain required.
cudo check, cudo compile, cudo run, cudo inspect — that's the whole CLI.
Read the spec,
browse examples,
or just start writing.