Skip to content
PT

Static copy

Copied from docs/en/evidence/P00-G10-backend-completion.md in https://github.com/poppy-team/aipo-lang (MIT). Pinned to revision ce47c4e070404fc41722ccd8e2b7b808b99062a8, blob 1e9fbc8be934802bc02ad372e9598bb8d58d59ed. The source repository remains canonical; this copy is refreshed through a sync pull request, not live.

Evidence — P00-G10 / Backend Completion (gaps inside S1–S9) ​

Goal: P00-G10 — Backend Completion: functions, closures, collections, Byte/Range/slice, and module execution Phase: P00 (Foundation) · Recorded: 2026-09-15 Environment: rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05), Linux

Proof attachments for the required gates. Commands are reproducible from the repository root.

Why this goal existed ​

Slices S1–S9 delivered each stage of the pipeline with its own tests, but the stages were not yet wired to each other end to end: the parser produced calls that the bytecode emitter could not lower, the VM had no first-class function values, the collections API stopped at the operations that need no callback, and import/export were specified in S9 but never executed. This goal closes those gaps so that a .aipo program can use the full MVP subset through aipo run.

What changed, by stage ​

StageCrateGap closed
Frontendaipo-syntaxf"..." interpolation desugars to String(...) concatenation; a[a..b], a[..b], a[a..] and a[..] parse into range-index expressions instead of a bare a[a]
Core IRaipo-irstruct declarations carried on Program; BuildStruct initializes fields in canonical order; two new opcodes for default parameters and the callee-side prologue
Bytecodeaipo-bytecode, aipo-bytecode::modulestruct table on BytecodeModule; emitter, verifier and disassembler cover every new opcode
VMaipo-vmfirst-class function values and closures with upvalues; Value::Byte/Value::Bytes/Value::Type; type tests; range and slice indexing; receiver-aware call frames; MutationDuringIteration enforcement on List/Dict iteration
Stdlibaipo-stdlibcollections.rs binds List/Dict methods to the VM; conversions delegate to the VM so String(v) and io.print(v) cannot diverge; String/Bytes method surface
Semaaipo-semaPrelude surface (docs/…/mvp-subset.md) is visible to name resolution
CLIaipo-climodules.rs resolves and executes import/export with a topological order and init-once semantics

Gate: fmt ​

$ cargo fmt --all -- --check
FMT_EXIT=0

Gate: check ​

$ cargo check --workspace --all-targets
    Finished `dev` profile [unoptimized + debuginfo] target(s)

Gate: clippy (workspace lints deny warnings) ​

$ cargo clippy --workspace --all-targets -- -D warnings
(no output, exit 0)

Gate: test ​

$ cargo test --workspace
passed: 136  failed: 0

Per crate:

CrateTestsCrateTests
aipo-source5aipo-ir2
aipo-diagnostics3aipo-bytecode4
aipo-lexer5aipo-vm24
aipo-syntax13aipo-runtime10
aipo-ast1aipo-stdlib30
aipo-hir4aipo-formatter11
aipo-sema8aipo-cli16

The gap-closing work is pinned by the conformance corpus rather than by unit tests alone. Each program fixture in docs/conformance/programs/ is executed through the real pipeline and compared against committed stdout, and each diagnostic fixture must fail with its committed code:

FixtureGap it proves closed
02_recursion, 11_defaults_and_named_argsfunctions with real locals/params, default parameters evaluated per call, defaults referencing earlier parameters, named arguments in any order, pipeline into a call
06_closuresanonymous fn, capture, per-iteration capture in loops
04_collectionsList/Dict method API including the higher-order transform, filter and sort_by (which call back into Aipo through the VM)
09_slicingranges a..b, list/string slicing with negative bounds, omitted slice bounds
05_structs_and_implstruct with defaults, construction, impl methods, associated functions
07_strings_and_mathByte(255), string/math surface, f"..." interpolation
diagnostics/08_runtime_mutation_during_iterationAIPO_RT_MUTATION_DURING_ITERATION
modules/basic, modules/cycle, modules/missingimport/export execution, init-once, privacy, AIPO_SEM_IMPORT_CYCLE, AIPO_SEM_UNKNOWN_MODULE

Gate: doc ​

$ cargo doc --workspace --no-deps
   Generated /home/raillen/Documentos/Projetos/aipo-lang/target/doc/aipo_ast/index.html and 14 other files

Gate: documentation_impact ​

  • docs/stdlib/mvp-subset.md — module execution is no longer listed as S9-only; the List/Dict method surface and the reason the higher-order methods live in the VM are recorded.
  • docs/adp/ADP-001-byte-and-core-types-as-values.md — Q1 and Q2 are resolved by this slice (Value::Byte and first-class type values now exist); the remaining open questions stay open.
  • docs/evidence/P00-G12-conformance-and-mvp-gate.md — the corpus this slice validates is scored there.
  • CHANGELOG.md, PROJECT_STATE.md.