Skip to content

Repository files navigation

🌊 Fluxon

The AI-native general-purpose programming language

A simple, fast, batteries-included language — designed so AI agents write it well, with the LLM built in as a first-class primitive.

Build Release License: MIT

Install · Docs · Examples · Spec · Roadmap · O'zbek


Philosophy: "The language adapts to the AI, not the AI to the language."

Fluxon is a general-purpose programming language — like Go or Python, you use it to write scripts, tools, data-processing, services, and full applications. What makes it different is who it was designed for: AI agents.

Today's languages were built for humans. They let you do one thing a dozen ways, with syntax that's convenient but token-wasteful. For an AI agent that's noise — every "decision point" is a chance to slip, every redundant character wastes context. Fluxon takes the opposite path: one task = one way, short but readable syntax, and the things AI-era programs reach for most — including the LLM itself — built right into the language.

A whole web service in one file

Everything you reach for — HTTP, a database, the LLM — is already in the language. No frameworks, no npm install:

use http db

http.on :get "/hello" \req ->
  rep 200 {msg:"hello, world"}

http.serve 8080

That's a running server — no package installs, no connection code, no boilerplate. And the LLM is just as close: ai.ask / ai.json / ai.run are keywords, not an SDK, with providers auto-detected from the environment.


Install

Linux / macOS — one line (downloads the latest release, verifies its checksum, and installs it onto your PATH):

curl -fsSL https://fluxon-lang.com/install.sh | sh

Windows (PowerShell):

irm https://fluxon-lang.com/install.ps1 | iex

Then run a file:

fluxon run hello.fx        # run a .fx file
fluxon repl                # interactive REPL
fluxon --help              # all commands
Other install options

The installer always grabs the latest release. Prefer a manual download? Grab the archive for your platform from the releases page.

From source (Rust toolchain required):

cd runtime
cargo run -- run examples/demo.fx
# or install the binary:  cargo install --path runtime

Why Fluxon

🧩 General-purpose A real language — scripts, CLIs, tools, data work, and full services. Functions, closures, pattern matching, errors, parallelism (par), pipes (|>).
🎯 One task = one way The only way to iterate is each. One way to output. The AI never wonders "which way should I choose?" — there is no choice, so there are fewer mistakes.
Few tokens, still readable Short syntax, but never cryptic. Keywords are spelled out in full (each, match, else) — an AI seeing Fluxon for the first time understands it immediately.
🔋 Batteries included http, db, ai, auth, crypto, ws, cron, queue, reg, sh, tui, json — all built in. No npm install. Only what you use ends up in the binary (tree-shaking).
🤖 AI as a primitive Calling an LLM is a keyword, not an SDK. Structured output, confidence, token count, and cost all come back built in. Providers auto-detect from the environment.

Status — Beta

The language core and every battery in the spec are implemented and covered by 479 passing tests. The runtime (Rust, tree-walking interpreter) runs .fx files, serves HTTP/WebSocket, talks to a database, and drives LLM agents today.

What works right now
  • Language core: types, bindings (=/<-), fn/lambda/closure, if/each/match, operators, string interpolation, errors (fail/!/??), try/catch, par (parallel fan-out), and the |> pipe.
  • Core modules: str, math, rand, json, time, env, io, fs, sh, leveled log, plus assert + a built-in fluxon test runner and an interactive REPL.
  • Batteries (all of them): http (server + client + middleware + static), db (SQLite, transactions, schema, auto-migration, query builder), ai (LLM — ai.ask/ai.json/ai.run, Anthropic + OpenAI auto-detect, tool-loop, confidence/token/cost metadata, retry + timeout), auth (JWT + password hashing), crypto, ws (websocket), cron, queue, reg (tool registry for agents).

The CLI ships fluxon run, fluxon check (lex + parse), fluxon test, and an interactive fluxon repl.

What's still on the roadmap (Postgres/MySQL backends, semantic/static checking, fluxon fmt, packaging, an LSP) is tracked in docs/ROADMAP.md.


How the language was designed

Fluxon was built through stress testing — with evidence, not guesswork:

  1. Research — we studied which code patterns AI writes most reliably and with the fewest tokens (declarative DSLs, canonical form, batteries).
  2. Invention — several AI models were each asked to "invent a language for AI." Independently, multiple models converged on the same ideas — and that convergence showed there is a "correct" design.
  3. Testing — the spec was handed to AI models that had never seen the language (opus, sonnet, haiku) and asked to build real projects. Each "spec gap" a model hit exposed a real shortcoming.
  4. Refinement — the gaps were closed, then re-tested. Over several rounds the language deepened — from small utilities to large systems.

The whole process is preserved in the research/ folder.


Explore

Path What's inside
docs/fluxon-agent.md Compact spec for AI agents (~10k tokens)
docs/fluxon-human.md Detailed guide for humans
examples/support-tickets/ AI classification + confidence routing
examples/ecommerce/ Catalog, cart, checkout (transaction), AI recommendations
examples/chat/ Realtime websocket + AI moderation
research/ How the language was born — design experiments

Contributing

Fluxon is open source — we welcome your help.


License

MIT


Fluxon isn't built to replace or outcompete existing programming languages. The goal is just one: to be the language AI knows best and likes most.

About

A programming language designed for ai agents — minimal tokens, canonical syntax, batteries included.

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages