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.
2.4 KiB
00. Status and Conformance
Status: Draft 0.1
Audience: compiler, verifier, runtime and tooling implementers
1. Normative terminology
The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT and MAY are normative requirements.
2. Conforming implementation
A conforming Aji implementation consists of:
- a source frontend or another mechanism that produces valid AIR;
- an AIR verifier;
- either an AIR interpreter or backend whose observable behavior follows the specification;
- the required runtime profile definitions;
- stable machine-readable diagnostics for normative verifier failures.
A source compiler that emits AIR without running the normative verifier is not a conforming safe Aji implementation.
3. Safe and unsafe Aji
Safe Aji is code that uses no unsafe operation and depends only on safe public interfaces.
Safe Aji MUST NOT exhibit, assuming a conforming implementation and correct hardware:
- use-after-free;
- double-free;
- dangling safe references;
- out-of-bounds memory access;
- uninitialized reads;
- invalid mutable aliasing;
- null dereference through safe references;
- data races involving ordinary memory;
- use of a consumed linear resource;
- forged capabilities.
Undefined Aji Behavior is restricted to violation of documented unsafe preconditions.
4. Profiles
A conforming implementation MAY support one or more profiles:
hosted: operating system, runtime scheduler, I/O and allocator;threaded: OS threads without the Aji task scheduler;freestanding: no mandatory OS, heap, task or I/O facilities;deterministic: runtime-controlled nondeterminism and replay;high-assurance: rejects unsafe code and optionally rejects runtime-only contract checks.
Profiles MUST NOT silently change core language semantics.
5. Compatibility
Version 0.x is experimental. AIR binary formats, source syntax and verifier rules MAY change incompatibly between minor releases.
Every AIR module MUST encode:
- AIR format version;
- required feature bits;
- target-independent semantic version;
- optional target requirements.
6. Observable behavior
The implementation MUST preserve:
- specified integer overflow behavior;
- specified trap points, except when a proof eliminates an impossible trap;
- synchronization semantics;
- effect/capability checks;
- resource linearity;
- safe memory behavior.
Optimization MAY remove checks only when their failure is provably impossible.