Geo Carncross presents kOS as a radical case study in eliminating code bloat, demonstrating how a full graphical OS with database capabilities fits in 90KB while outperforming mainstream systems by orders of magnitude.
In an era where software bloat is accepted as inevitable, Geo Carncross's work on kOS presents a provocative counter-narrative. As a developer for high-stakes ad-serving infrastructure processing terabytes daily with 50ms latency requirements, Carncross brings practical urgency to his critique of modern programming practices. His central thesis: unnecessary code is a bug, not an inevitability.
Redefining Code Bloat
Carncross strictly defines bloat as redundant code within a source tree – distinct from feature debates or compiler optimizations. This bloat has tangible consequences: larger binaries, slower execution, and cognitive overhead when multiple programmers duplicate efforts across large codebases.
kOS: The Living Proof
kOS dismantles assumptions about minimalism's limits:
- 90KB binary containing GUI OS, K language interpreter, code editor, file manager, and presentation tool
- Columnar database (kdb) handling trillion-row datasets
- Graphical environment (z) with window management
This density is achieved through ruthless elimination of redundancy. The K language interpreter spans just 300 lines of C across 5 files; the entire kernel is 100 lines of assembly. Carncross emphasizes this isn't about compression tricks but fundamental design philosophy.
Performance Paradox
Benchmarks reveal kdb processing queries 1,000x faster than SQL equivalents. When Carncross runs i:1000000(1+)/1 (equivalent to a million-iteration loop), K completes in 8ms versus C's 191ms. This inverts conventional wisdom: instead of asking "why is K fast?", we should ask "why are other systems so slow?"
Live Coding Demonstration
Carncross demonstrates K's live-coding environment while adding editor features:
- Views as memoized dependencies (
c::a$"\n") auto-update when inputs change - Control-key bindings implemented via direct manipulation of cursor state (
ca:{hx 0 -1}) - Delete functionality added in 2 lines by modifying selection state (
cd:{K j+!2;kx""})
The environment exemplifies K's conciseness: the presentation tool's entire source fits in four lines displayed during the talk.
Philosophical Provocations
Carncross challenges sacred cows of software engineering:
- Big O notation ignores hardware realities (arrays O(1) at small scales become O(log n) when cache misses occur)
- B-trees and hash tables are suboptimal for many real-world data sizes
- Best practices (OOP, unit tests, syntax highlighting, package managers) become "straw men" hindering serious system design discussions
His team bans the term "best practice" entirely, requiring justification for any convention "even if everyone else is doing it."
Implications for Programmers
The kOS experiment suggests:
- Programmers must take responsibility for performance and correctness at the hardware level
- Compact code enables novel approaches (like K's unified function-call/indexing syntax)
- Current abstraction layers often hide optimization opportunities
For those interested in exploration, Carncross suggests kdb+ (type \ to switch from q to K) while cautioning that open-source alternative Kona lacks kdb's performance.
This talk forces reconsideration of programming fundamentals: when the entire presentation system fits in four lines of code, our industry's terabytes-of-dependencies approach seems less like progress and more like collective myopia. As Carncross concludes: "Programming correctly is hard – but unnecessary complexity is not inevitable."
Comments
Please log in or register to join the discussion