Yon – a topos-oriented language with a content-addressed lattice heap
Yon is a new programming language inspired by category theory and topoi, featuring a unique content-addressed lattice heap that enables O(1) structural equality and automatic deduplication. It aims to redefine programming paradigms with its 'topos-oriented' approach, eliminating garbage collection, threads, and exceptions. This story appeals to HN's fascination with innovative, mathematically-grounded language design and claims of performance and simplicity.
The Lowdown
Yon is a new programming language developed by a self-described non-mathematician who explored advanced mathematical concepts like category theory and topoi to influence type theory in programming. Born from three weeks of intensive work, Yon aims to push the boundaries of programming language design by integrating these abstract mathematical frameworks into its core. The language compiles to LLVM for performance, eschewing traditional VMs and GCs, and introduces several unconventional features designed for efficiency and conceptual clarity.<ul><li><b>Topos-Oriented Paradigm</b>: Yon views "worlds" as categories, "places" as objects, and values as immutable "sections" identified by content. Behavior is represented by "arrows."</li><li><b>Content-Addressed Lattice Heap</b>: The heap is based on the Leech lattice (Λ₂₄) where the address of a value is its content. This design ensures O(1) structural equality, automatic global deduplication, and eliminates the need for a garbage collector.</li><li><b>Compiler Architecture</b>: The compiler features an OCaml frontend that translates .yon source into a custom MLIR dialect called "topos," which then lowers to LLVM IR for native execution.</li><li><b>Simplified Concurrency</b>: Yon employs an intentionally simple concurrency model: no threads or shared mutable state. Programs run as isolated "Spaces" (separate processes) communicating via shared-memory channels with explicit failure semantics.</li><li><b>Absence of Common Features</b>: The language deliberately omits garbage collection, threads, exceptions (failure is a value), and typeclasses (arrows serve as interfaces).</li><li><b>Robust Verification</b>: The project includes a 112-example regression suite and a cross-Space scenario suite, with the accompanying book's code snippets verified before publication.</li><li><b>Defined Limitations</b>: Version 1.0 outlines explicit hard limits for various resources (e.g., heaps per chain, Spaces, RPC sessions), treating soft limits that degrade silently as bugs.</li><li><b>Licensing</b>: The compiler and toolchain are under AGPLv3, with the runtime also AGPLv3 but including a linking exception to ensure user programs remain freely licensed.</li></ul>Ultimately, Yon seeks to bring fresh stimuli to programming by re-imagining language fundamentals through the lens of mathematical formalization, potentially opening new frontiers in software development.