Draft specification, RFCs, reference registries and examples, plus the reference-implementation skeleton: build.zig, diagnostic envelope with error-code registry synced to docs, aji CLI, conformance runner with seed tests, CI and contributor docs.
121 lines
3.6 KiB
Markdown
121 lines
3.6 KiB
Markdown
# Aji
|
|
|
|
**Aji** is an experimental systems programming language designed primarily for software generated and maintained by AI agents.
|
|
|
|
Aji optimizes for explicit semantics, machine verification, predictable execution, memory safety without garbage collection, structured concurrency, explicit capabilities, and machine-readable diagnostics.
|
|
|
|
> Aji is not "assembly for agents". It is a small, typed, verifiable systems language whose canonical semantic representation is AIR (Aji Intermediate Representation).
|
|
|
|
## Status
|
|
|
|
Specification status: **Draft 0.1**.
|
|
|
|
Nothing in this repository should yet be treated as a stable compatibility promise.
|
|
|
|
## Core model
|
|
|
|
```text
|
|
human specification
|
|
↓
|
|
AI agent
|
|
↓
|
|
Aji
|
|
↓
|
|
compiler + verifier
|
|
↓
|
|
AIR
|
|
↓
|
|
interpreter / backend
|
|
↓
|
|
native executable
|
|
```
|
|
|
|
The central language ideas are:
|
|
|
|
- explicit ownership rather than implicit GC;
|
|
- `Region` for bounded-lifetime bulk allocation;
|
|
- `Island<T>` for uniquely owned mutable object graphs;
|
|
- `Frozen<T>` for deeply immutable shared graphs;
|
|
- structured tasks that cannot silently outlive their scopes;
|
|
- ownership transfer as the preferred concurrency mechanism;
|
|
- `Mutex`, channels and atomics only when sharing is required;
|
|
- explicit effects and capabilities for external authority;
|
|
- stable machine-readable verifier diagnostics;
|
|
- deterministic execution and replay as first-class tooling.
|
|
|
|
## Repository map
|
|
|
|
```text
|
|
docs/spec/ Normative language specification
|
|
docs/rfcs/ Major design RFCs and rationale
|
|
docs/reference/ Grammar, error codes, intrinsics, glossary
|
|
docs/roadmap/ Implementation and conformance plans
|
|
src/ Reference implementation (Zig): diagnostics, AIR, verifier, interpreter
|
|
tools/ Conformance runner
|
|
tests/ Conformance suite (.air accept/reject tests)
|
|
examples/ Illustrative Aji programs
|
|
AGENTS.md Instructions for AI coding agents
|
|
CONTRIBUTING.md Toolchain, commands, workflow, definition of done
|
|
```
|
|
|
|
## Building
|
|
|
|
Requires Zig 0.17.0 (`mise install` picks it up from `mise.toml`).
|
|
|
|
```sh
|
|
zig build # ./zig-out/bin/aji
|
|
zig build test # unit tests
|
|
zig build conformance # conformance suite
|
|
```
|
|
|
|
Current state: Phase 0 has not started. `aji check` reports every input as not yet decidable; see [`docs/roadmap/phase-0.md`](docs/roadmap/phase-0.md) for the task breakdown.
|
|
|
|
Start with [`SPEC.md`](SPEC.md), then:
|
|
|
|
1. `docs/spec/00-status-and-conformance.md`
|
|
2. `docs/spec/01-language-overview.md`
|
|
3. `docs/spec/03-memory-model.md`
|
|
4. `docs/spec/04-concurrency-and-atomics.md`
|
|
5. `docs/spec/07-air.md`
|
|
6. `docs/spec/08-verifier.md`
|
|
|
|
## Design thesis
|
|
|
|
Traditional systems languages mainly optimize the interface:
|
|
|
|
```text
|
|
human → source code
|
|
```
|
|
|
|
Aji instead optimizes:
|
|
|
|
```text
|
|
AI agent → verified executable system
|
|
```
|
|
|
|
The source representation therefore prioritizes semantic explicitness, bounded complexity, deterministic repair loops and mechanically enforceable invariants over convenience features designed primarily for manual authoring.
|
|
|
|
## Reference implementation direction
|
|
|
|
The proposed reference implementation is written primarily in Zig and should be implemented in this order:
|
|
|
|
```text
|
|
AIR data model
|
|
→ AIR parser/serializer
|
|
→ interpreter
|
|
→ ownership verifier
|
|
→ borrow/region verifier
|
|
→ structured concurrency verifier
|
|
→ deterministic scheduler
|
|
→ Aji source parser
|
|
→ standard library
|
|
→ LLVM lowering
|
|
→ native runtime
|
|
```
|
|
|
|
Do not start by writing a native code generator. The interpreter and verifier define the semantics.
|
|
|
|
## License
|
|
|
|
No license has been selected yet. Add one before public distribution.
|