AIL — An AI-Authored Programming Language
A programming language where AI is the programmer and humans are the stakeholders.
Install
pip install ail-interpreter
# or: pip install 'ail-interpreter[anthropic]' # for the Anthropic adapter
The PyPI distribution is ail-interpreter — this wheel is the
Python interpreter of AIL, not the language itself. The canonical
spec lives in spec/ and a second interpreter lives in go-impl/.
(ail and ailang are both unavailable on PyPI for naming-policy
reasons.) The Python import name is ail:
from ail import run, ask
and the CLI is ail.
The idea
AIL has two kinds of functions:
pure fn word_count(text: Text) -> Number {
return length(split(text, " "))
}
intent classify(text: Text) -> Text {
goal: positive_negative_or_neutral
}
entry main(review: Text) {
words = word_count(review) // pure fn — no LLM, confidence 1.0
label = classify(review) // intent — LLM call, confidence ≤ 1.0
return join([label, " (", to_text(words), " words)"], "")
}
pure fn is for what the AI can compute — sorting, parsing, arithmetic.
Deterministic, no LLM call, no side effects, statically checked.
intent is for what the AI needs to reason about — sentiment,
summarization, translation. The runtime dispatches to a language model
and returns a (value, confidence) pair.
The language distinguishes the two at declaration time, so you always know which calls are free and deterministic and which need a model.
Two ways humans use it
ail ask — the natural interface
export AIL_OLLAMA_MODEL=llama3.1:latest # or ANTHROPIC_API_KEY=...
ail ask "Count the vowels in 'Hello World'"
# 3
ail ask "factorial of 7" --show-source
# 5040
# (stderr) --- AIL ---
# (stderr) pure fn factorial(n: Number) -> Number {
# (stderr) if n <= 1 { return 1 }
# (stderr) return n * factorial(n - 1)
# (stderr) }
# (stderr) entry main(x: Text) { return factorial(7) }
Human types English. An LLM writes AIL. The runtime executes it. The human sees the answer. The AIL is transparent infrastructure — inspectable on demand, invisible by default.
ail run — for programs written explicitly
ail run examples/fizzbuzz.ail --input "20" --mock
When you want to read or write AIL yourself.
What's in v1.8
| Feature | What it does |
|---|---|
pure fn |
Statically verified — no intents, no effects, no impurity leaks |
intent |
LLM-backed, returns (value, confidence) |
| Provenance | Every value carries its origin tree; queryable via origin_of, lineage_of, has_intent_origin, has_effect_origin |
| Calibration | Confidence recalibrates from observed outcomes. calibration_of("intent") introspectable from code |
| attempt | Confidence-priority fallback cascade — cheap pure try first, LLM only as fallback |
| match | Pattern matching with confidence guards — "positive" with confidence > 0.9 => ... |
| Parallelism | Independent intent calls run concurrently with no async/await |
| Effects | perform http.get(url), perform file.read(path), etc. |
| Evolve | Intents can self-modify (retune, rewrite constraints) with rollback and history |
ail ask |
Natural-language → AIL authoring loop with parse-error retry |
Adapters for Anthropic, Ollama (local), and Mock (tests) ship built-in.
A second interpreter in Go (see the project repo) runs the same .ail
files with no Python installed at all.
Python API
from ail import run, ask, AskResult
# Direct program run:
result, trace = run("path/to/program.ail", input="hello")
result.value # the entry's return value
result.confidence # calibrated confidence
result.origin # full provenance tree
# Natural-language interface:
r = ask("compute the factorial of 7")
r.value # 5040
r.ail_source # the AIL the author produced
r.retries # 0 if first try parsed
See the language reference card for the complete surface.
Why this exists
Humans don't write AIL. Humans say what they want in natural language; an LLM writes AIL; the runtime executes it; the result comes back.
The value of the language is in what it guarantees about the code the AI writes:
- Every pure computation is statically separated from every LLM call.
- Every value carries the full chain of operations that produced it.
- Confidence is a first-class runtime property, recalibrated by observation.
- A
pure fnthat passes parsing is proven to contain no LLM call, no side effect, and no path to one. The model cannot slip an intent past the compiler. - Independent LLM calls parallelize without the author writing
async.
For the full design rationale, see the spec.
License
Apache 2.0.
Metadata
Release files for ail-interpreter 1.83.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ail_interpreter-1.83.0.tar.gz | 531.8 kB | Without provenance | Details for ail_interpreter-1.83.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ail_interpreter-1.83.0-py3-none-any.whl | Python 3 | none | any | Details for ail_interpreter-1.83.0-py3-none-any.whl |
Total release size: 930.7 kB
Release files / ail_interpreter-1.83.0.tar.gz
| Download URL | ail_interpreter-1.83.0.tar.gz |
|---|---|
| Size | 531.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54e24781cf8962f6b790d3ba4b596a613bf450e46388e62462330ba9a2098f83
|
|
BLAKE2b-256 checksum How to use checksums |
3481977769c2c05d1c265976bd817c4acc7c542a49cdd4050303840975c9cdc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / ail_interpreter-1.83.0-py3-none-any.whl
| Download URL | ail_interpreter-1.83.0-py3-none-any.whl |
|---|---|
| Size | 398.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85b10209bbf4dad29735fdcb898d8f97c65cb3761d81b0bbdadf7fa8e3ec1e59
|
|
BLAKE2b-256 checksum How to use checksums |
bdf1fbe9880a1873c7b45029374b1b4cc54047f3d50f50777614573ab3f2ac40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for ail-interpreter 1.83.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.