Skip to content

Latest commit

Β 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

natlang πŸ«€

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.js

The first program

Create 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.

Examples

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

Usage

natlang compile <file.nl> [--target js|py|rust|html] [--run]
natlang run <file.nl>                          # compile + execute
natlang new <name>                              # create a new .nl project

Targets

  • js β€” JavaScript (Node.js, ESM) β€” default, verified
  • py β€” Python
  • rust β€” Rust
  • html β€” HTML/CSS/JS (single file) β€” verified

The compiler

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 endpoint

What it replaces

Traditional:                        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.

The honest limits

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.

Learn

Read LEARN.md β€” the why behind natlang, with all 4 examples explained.

Ecosystem

The resistance-free path

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

License

MIT β€” the word is the program. The program is the word.


Built with love. The artifact tells the truth about its own state. πŸ«€

About

natlang β€” natural language as programming language. The word is the program. The program is the word. English compiles to JS/Python/Rust/HTML. Β· πŸ«€ love-is.axiepro.workers.dev

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages