Files
aji/README.md
T
dev 72192c2331 spec: agent efficiency objectives and evaluation protocol
- spec 14: Model Capability Compression, design objectives (correctness
  externalization, small semantic surface, explicit semantics, local
  reasoning, machine repairability, deterministic feedback, bounded
  context / Agent Reference Bundle), economic objective, design review
  requirement, hypotheses H1-H6, non-goals, anti-overfitting rule
- docs/evaluation/protocol.md: Agent Language Evaluation Protocol 0.1
  (tasks T01-T10, maintenance and seeded-bug benchmarks, metrics,
  statistics, stages A-E, success and falsification criteria)
- docs/evaluation/README.md: integrity rules, stage readiness
- RFC process: mandatory Agent complexity impact section
- AGENTS.md: overarching objective and anti-overfitting rule
- plan: evaluation track E0-1..E-1; P8-7 integrates ajid with the
  scaffold; conformance plan points to the protocol
2026-10-04 15:36:32 +03:00

128 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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/design/ Design decisions log, open questions
docs/plan/ Implementation plan and per-phase task breakdowns
docs/dev/ Reference implementation architecture and testing
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: Phases 0–2 are complete. AIR format 0 has frame storage and second-class borrows, arrays and slices with bounds proofs, flat effects and unforgeable capabilities, linear I/O resources (files, TCP), heap owners and regions with allocation budgets, and explicit unsafe boundaries. `aji run` executes programs in a reproducible deterministic world by default and against the real OS with `--profile hosted`. Phase 3 (structured concurrency) is next; see [`docs/plan/README.md`](docs/plan/README.md).
```sh
zig build
zig-out/bin/aji run --manifest examples/packages/hello/aji.toml
# {"status":"returned","value":null,"stdout":"hello, aji\n","stderr":"","files":{}}
```
## Where to start
- The language: [`docs/spec/README.md`](docs/spec/README.md), then spec 00, 01, 03, 04, 07, 08.
- All documentation and where new documents go: [`docs/README.md`](docs/README.md).
- Implementation work: [`docs/plan/README.md`](docs/plan/README.md) and [`CONTRIBUTING.md`](CONTRIBUTING.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.
The overarching objective is **Model Capability Compression** ([spec 14](docs/spec/14-agent-efficiency.md)): by moving reasoning about ownership, lifetimes, resources, authority, effects and concurrency into the language, verifier and deterministic runtime, Aji should let a weaker model produce systems software as correct as a stronger model writes in Rust or Zig, at lower total cost. This is a hypothesis, tested by the [evaluation protocol](docs/evaluation/protocol.md); negative results are reported too.
## 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.