Axion

A sandbox for code that AI writes.

The rules of the language fit on two pages. A model writes a program from them; one call, axionlang.run, checks it and runs it safely. Or axionlang.ask does it all: asks your model, checks, runs, and fixes by the errors.

Why its own syntax, not Python?

It is an experiment. We are testing a hypothesis: a deterministic syntax with no syntactic sugar helps models write correct code, so that small local models (14B–32B) could one day write reliable code offline and for free. That is not proven yet. What already works: the engine refuses inexact data, does no implicit conversions, and never guesses for the model. If something is wrong, it stops and says exactly what.

Generate a program with your own AI, or try a ready example. The real engine runs here in your browser. Nothing is sent anywhere.

Generate with your AI

Use any chat model you already have, such as ChatGPT or Claude. No key is needed: you carry the text between the two tabs.

1 Describe a task

2 Ask your AI

Paste the prompt into your chat. It contains the Axion cheat sheet and your task, and asks for two code blocks: the program and sample data.

3 Paste and run

Copy the first block into the Program window below, and the second into the Data window. Your chat shows a copy button on each block.

Have your own data? Use Load JSON file in the Data window. Then press Run.

If Axion stops the program, press Copy error for your AI under the error, paste it into the same chat, and paste the fixed program back into the Program window. This is the loop that axionlang.ask runs for you in code.

Or try a ready example

ProgramAxion
Data
Loading the engine (about 10 MB, once)…
Axion cheat sheet

  
160 / 160runs with malformed data stopped by Axion. Python programs for the same tasks: 117 / 160.
10 / 10attempts to hang the engine ended inside the limits. The same attempts in Python: 10 / 10 hung.
~50×slower than Python. Axion is for small calculations, not for heavy work.

Use it from Python

pip install axionlang, then axionlang.run(program, data), or axionlang.ask(model, question, data, shape=...) to let your own model write the program and fix it from Axion's errors.

Limits of this page: 200,000 steps, 100,000 printed characters, 1,000,000 list elements, call depth 200, 256 MB of kept data. The library default is 1,000,000 steps.

Source on GitHub · axionlang on PyPI · The benchmark · Feedback: open an issue · MIT licence