We've been running Cursor Ultra ($200/month) in Auto Mode for extended sessions — sometimes 8+ hours of autonomous development. This repository is the result: 170k+ lines of Zig, a complete RISC-V64 operating system.
*The Cursor Ultra Experience:*
Auto Mode changes everything. Instead of prompting line-by-line, we describe high-level goals:
- "Fix all compilation errors in the JIT compiler"
- "Add TCP socket support with proper error handling"
- "Refactor this function to be under 64 lines"
The AI then works autonomously: reading files, understanding context, making coordinated changes across the codebase, writing tests, updating documentation. It's pair programming where your partner has read every file and never gets tired.
*What makes the code different:*
1. *AI-friendly style guide* – We created "Grain Style" specifically for AI-assisted development:
- 64-line function maximum (2^6)
- 128-character line maximum (2^7)
- No recursion
- 2+ assertions per function
- Explicit types (u32/u64 never usize)
- Every comment explains "why"
The AI follows these rules more consistently than humans would. 48 of 56 kernel files are fully compliant.
2. *Pure Zig* – No C dependencies except libc for host tools. Zig's comptime features let us do things that would require macros or code generation in C.
3. *JIT Compiler* – Working x86_64 JIT that translates RISC-V instructions to native code. Near-native speed on x86 hosts.
4. *249 Tests* – Essential for AI-written code. The AI writes the tests too.
*Technical highlights:*
- Kernel boots on QEMU RISC-V64 with virt machine
- 60+ syscalls (process, memory, IPC, network, audio, filesystem)
- TCP/UDP networking with socket abstraction
- Grainscript: a minimal scripting language with lexer, parser, interpreter
- Process scheduler with priority queues
- ELF loader supporting RISC-V64 binaries
- Framebuffer graphics with dirty region tracking
*The economics:*
$200/month for Cursor Ultra. This codebase would have taken a small team several months at $15-20k+ in developer costs. We built it in weeks.
The catch: you still need to know what you're building. AI amplifies capability, it doesn't replace vision.
*Roadmap to Alpha:*
Bottleneck: Basin kernel → Vantage VM → Framework x86_64. Target application: *first-responder dispatch software*.
Contributors needed for ARM aarch64 (Apple Silicon) — Zig → C → Swift macOS app. Also designing Aurora (open-source iOS Cursor alternative) with two inference backends:
- [Cursor CLI Ultra](https://cursor.com) ($200/month)
- [Cerebras WSE](https://cerebras.ai) — spatial RAM, single-threaded bounded compute, deterministic latency
*Current status:*
Kernel boots, REPL works, Grainscript executes.
Built with Zig 0.15.2. Follows [Grain Style](docs/grain_style.md). MIT/Apache-2.0/BSD-3-Clause licensed.