GitHub - jordanhubbard/nanolang: A tiny experimental language designed to be targeted by coding LLMs
3 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
NanoLang is a lightweight programming language designed for large language models. It features mandatory testing, unambiguous syntax, and verified semantics. NanoLang can compile to native C or run on its own virtual machine with isolated foreign function interface support.
If you do, here's more
NanoLang is a minimal programming language designed for compatibility with large language models (LLMs). It emphasizes mandatory testing, clear syntax, and rigorous formal verification. The language transpiles to C for optimal performance but also includes a custom virtual machine called NanoISA, which features process-isolated foreign function interfaces (FFI). Its core semantics are verified in Coq without relying on axioms, ensuring type soundness, determinism, and semantic equivalence.
To get started with NanoLang, users can follow a comprehensive user guide and quick start guide. The language requires every function to have associated test blocks, promoting robust code. It supports both prefix and infix notation, with automatic memory management through reference counting. The syntax allows for immutable variables by default, with mutability optional. Features like structs, enums, and generics make it versatile for different programming needs.
The NanoISA virtual machine supports 178 opcodes and offers isolation for external function calls to protect against crashes. Users can compile to bytecode for sandboxed execution or create native binaries that embed the virtual machine. The architecture includes features like a persistent VM daemon for reduced startup time and a trap model to separate computation from I/O operations. The formal verification covers core data types and control structures, ensuring reliable behavior in programs.
For practical use, NanoLang includes a web playground for learning and an examples browser for hands-on experience with various coding scenarios. The language is compatible with several operating systems, including Ubuntu, macOS, and FreeBSD, while Windows users can utilize WSL2. Resources for LLM training and guidelines for contributing to the project are also available, all under the Apache License 2.0.
Questions about this article
No questions yet.