72e54f4fd3
The surface-form file extension changes from .ailx to .ail. AILang's
authoring surface now uses the same .ail stem as its canonical JSON
form (.ail.json), giving the language a single coherent extension
family: .ail is the LLM-authored Form A, .ail.json is the canonical
JSON-AST Form B.
Scope (touched):
- 61 example renames examples/**/*.ailx → .ail (git mv)
- 1 rename experiments/.../rendered/ailx.md → ail.md
- 35 content-edited live-toolchain files (crates/, docs/DESIGN.md,
docs/roadmap.md, docs/PROSE_ROUNDTRIP.md, skills/, bench/reference/*.c,
experiment crates under experiments/.../{render,harness,master})
- Experiment-crate cohort rename Cohort::Ailx → Cohort::Ail,
Form::Ailx → Form::Ail, per_cohort/ailx → per_cohort/ail,
{form-only: ailx} → {form-only: ail}, ```ailx → ```ail
Out of scope (deliberately untouched, to preserve honest history):
- docs/journal-archive.md (content-frozen per CLAUDE.md)
- docs/journals/, docs/specs/, docs/plans/, bench/orchestrator-stats/
- experiments/.../runs/ (frozen LLM-output artefacts; models actually
saw .ailx — renaming would falsify the experimental record)
Verification: cargo build/test --workspace green; experiment crate
cargo test green; bench/check.py + compile_check.py + cross_lang.py
all 0-regressed; negative grep for ailx|Ailx|AILX outside the
out-of-scope paths returns zero matches.
Opens immediate follow-up: roadmap.md P2 todo `ail check`/build/run
accept .ail extension — after this rename, .ail is canonical
authoring surface but the CLI still produces a misleading JSON-parse
error on `ail check foo.ail`. That's the next iter.
62 lines
2.4 KiB
Plaintext
62 lines
2.4 KiB
Plaintext
; Iter 15b — second consumer demo.
|
|
; Imports both std_maybe and std_list. Exercises every combinator at
|
|
; least once. xs is a top-level fn `() -> List<Int>` (consts cannot
|
|
; reference user fns; the brief flagged this).
|
|
|
|
(module std_list_demo
|
|
|
|
(import std_maybe)
|
|
(import std_list)
|
|
|
|
(fn inc
|
|
(doc "Add 1 to an Int. Used as the (a -> b) arg to map.")
|
|
(type (fn-type (params (con Int)) (ret (con Int))))
|
|
(params x)
|
|
(body (app + x 1)))
|
|
|
|
(fn add
|
|
(doc "Binary +. Used as the fold accumulator op.")
|
|
(type (fn-type (params (con Int) (con Int)) (ret (con Int))))
|
|
(params a b)
|
|
(body (app + a b)))
|
|
|
|
(fn is_even
|
|
(doc "Predicate: x mod 2 == 0.")
|
|
(type (fn-type (params (con Int)) (ret (con Bool))))
|
|
(params x)
|
|
(body (app == (app % x 2) 0)))
|
|
|
|
(fn double
|
|
(doc "Multiply by 2. Used as the map arg.")
|
|
(type (fn-type (params (con Int)) (ret (con Int))))
|
|
(params x)
|
|
(body (app * x 2)))
|
|
|
|
(const xs
|
|
(doc "The canonical list [1,2,3,4,5] for the demo. Pure ctor expression, so a const works.")
|
|
(type (con std_list.List (con Int)))
|
|
(body
|
|
(term-ctor std_list.List Cons 1
|
|
(term-ctor std_list.List Cons 2
|
|
(term-ctor std_list.List Cons 3
|
|
(term-ctor std_list.List Cons 4
|
|
(term-ctor std_list.List Cons 5
|
|
(term-ctor std_list.List Nil))))))))
|
|
|
|
(fn main
|
|
(doc "Drive each std_list combinator once. Expected outputs (per line): 5, false, true, 1, 4, 10, 5, 2, 2, 15, 15.")
|
|
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
|
(params)
|
|
(body
|
|
(seq (do io/print_int (app std_list.length xs))
|
|
(seq (do io/print_bool (app std_list.is_empty xs))
|
|
(seq (do io/print_bool (app std_list.is_empty (term-ctor std_list.List Nil)))
|
|
(seq (do io/print_int (app std_maybe.from_maybe -1 (app std_list.head xs)))
|
|
(seq (do io/print_int (app std_list.length (app std_maybe.from_maybe xs (app std_list.tail xs))))
|
|
(seq (do io/print_int (app std_list.length (app std_list.append xs xs)))
|
|
(seq (do io/print_int (app std_maybe.from_maybe -1 (app std_list.head (app std_list.reverse xs))))
|
|
(seq (do io/print_int (app std_maybe.from_maybe -1 (app std_list.head (app std_list.map double xs))))
|
|
(seq (do io/print_int (app std_list.length (app std_list.filter is_even xs)))
|
|
(seq (do io/print_int (app std_list.fold_left add 0 xs))
|
|
(do io/print_int (app std_list.fold_right add 0 xs)))))))))))))))
|