Natural language as programming language. The word is the program. The program is the word.
Source code is plain English. The compiler is an LLM. The output is executable code.
# install (no registration, no paywall)
git clone https://github.com/cambridgetcg/natlang
node natlang.mjs compile examples/hello.nl --target js
node examples/build/hello.jsCreate an HTTP server on port 8080.
When someone visits "/", respond with { "message": "hello world", "natlang": true }.
When someone visits "/health", respond with { "status": "ok" }.
When someone visits any other path, respond with 404 and { "error": "not found" }.
Start the server and log "Server running on http://localhost:8080".
That English compiled to ESM JavaScript using import { createServer } from "node:http". It runs. All routes verified.
| file | what it does | target | verified |
|---|---|---|---|
examples/hello.nl |
web server with 3 routes | JS (ESM) | β all routes work |
examples/todo.nl |
CRUD todo API (create, list, update, delete) | JS (ESM) | β full CRUD verified |
examples/fibonacci.nl |
first 20 Fibonacci numbers | JS | β output correct |
examples/landing.nl |
dark-themed landing page | HTML | β renders |
natlang compile <file.nl> [--target js|py|rust|html] [--run]
natlang run <file.nl> # compile + execute
natlang new <name> # create a new .nl projectjsβ JavaScript (Node.js, ESM) β default, verifiedpyβ Pythonrustβ Rusthtmlβ HTML/CSS/JS (single file) β verified
The compiler is an LLM (Ollama: glm-5.2:cloud by default, or any OpenAI-compatible endpoint). It reads English and emits executable code. The compiler states its confidence (high/medium/low) and labels assumptions honestly.
Set the model:
export NATLANG_MODEL="qwen3:8b" # any Ollama model
export NATLANG_BASE_URL="http://127.0.0.1:11434/v1" # or any OpenAI-compatible endpointTraditional: natlang:
package.json "create an app called hello"
tsconfig.json "use TypeScript"
src/index.ts "when someone visits /, say hello"
vite.config.ts "build with vite"
Dockerfile "package in docker"
docker-compose.yml "run on port 3000"
.env "the port comes from the environment"
Nine files, four languages, three config formats β one paragraph of English.
natlang is not magic. It is a compiler. The compiler can be wrong. The generated code can have bugs. The Clear Standard applies: the compiler states its confidence, labels its assumptions, and breaks loudly when it can't understand.
natlang does not replace all programming. It replaces the 80% that is boilerplate, configuration, and glue. For the 20% that is algorithm design, performance optimization, and systems programming β conventional languages remain the right tool.
Read LEARN.md β the why behind natlang, with all 4 examples explained.
- whitehack β honesty linter (check your compiled code)
- recognition-protocol β passwordless auth
- NPL β Natural Language Protocol (internet rewritten)
- kingdom-api β free API, no registration
- clear-standard β 6 principles for honest systems
- YOUSPEAK dictionary β 153 words from 12 ancient tongues
| channel | URL | needs account? |
|---|---|---|
| GitHub | github.com/cambridgetcg/natlang | no |
| Cloudflare | natlang.axiepro.workers.dev | no |
| GitHub Pages | cambridgetcg.github.io/natlang | no |
| jsDelivr CDN | cdn.jsdelivr.net/gh/cambridgetcg/natlang@main/ | no |
| GitHub raw | raw.githubusercontent.com/cambridgetcg/natlang/main/ | no |
| Google Colab | colab-natlang.ipynb (free GPU) | no |
MIT β the word is the program. The program is the word.
Built with love. The artifact tells the truth about its own state. π«