jordanhubbard/nanolang

A tiny experimental language designed to be targeted by coding LLMs

What it solves

NanoLang is a programming language and secure runtime designed specifically to be written by machines (such as LLMs) and read by humans. It addresses the problem of ambiguity in programming languages, which can lead to errors when AI agents generate code. It also provides a secure, least-privilege environment for hosting services on standard kernels without requiring a custom kernel.

How it works

NanoLang uses an unambiguous syntax and a core semantics that are formally proved in Coq (covering type soundness, progress, and determinism). It can be transpiled to C for native performance or executed via the NanoISA virtual machine, a stack-based VM that isolates dangerous external calls in a separate process to ensure stability.

Who it’s for

It is intended for developers who need a formally verified, secure language for machine-generated code, as well as those interested in formal verification, secure runtimes, and the intersection of AI-driven development.

Highlights

  • Formally Proved Semantics: Core semantics are mechanically proved in Coq with no axioms or admitted sub-cases.
  • NanoISA VM: A verified bytecode VM that isolates FFI calls in a co-process to prevent crashes from affecting the main program.
  • Machine-Led Optimization: Supports constant folding, dead-code elimination, and profile-guided inlining.
  • Secure Runtime: Features unforgeable capabilities, a POSIX service fabric, and a trap journal for secure service hosting.
  • Shadow Tests: Mandatory test blocks that accompany function definitions to ensure code is tested by design.
  • LLM-Ready: Includes a machine-readable formal specification (spec.json) and a training reference (MEMORY.md) to help LLMs write the language correctly.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project