ail builtins is an incomplete API scan — no comparison operators surfaced #69

Open
opened 2026-06-02 22:23:28 +02:00 by Brummel · 0 comments
Owner

ail builtins (the in-tree discovery tool, the cargo doc analogue for an AILang author) lists the primitive ops — + - * / %, not, neg, the int/float/str conversions, io/print_str — but no comparison operator at all: no gt/lt/le/ge/eq/ne/compare, and no Ordering/Bool surface.

Those live in examples/prelude.ail (the Eq/Ord classes and the free helpers lt/gt/le/ge/ne, plus compare returning the Ordering ADT). A consumer who scans the obvious discovery command never finds half the comparison stdlib — the discovery surface does not point at the library where comparisons live.

Impact. Surfaced in the cross-model authoring experiment: a frontier model (Claude), given the ail builtins scan, still could not find how to compare two Ints; only scanning the prelude source revealed compare/gt. A weaker model never recovers.

Suggested fix. Have ail builtins also list (or cross-reference) the prelude exported Ord/Eq surface with signatures, or add a discovery command that surfaces the prelude public functions. The discovery tool should be a complete API scan.

Evidence: experiments/2026-05-12-cross-model-authoring/familiar-vs-unfamiliar/ and the "Is AILang harder for a frontier model" section of experiments/2026-05-12-cross-model-authoring/format-findings.md.

`ail builtins` (the in-tree discovery tool, the `cargo doc` analogue for an AILang author) lists the primitive ops — `+ - * / %`, `not`, `neg`, the int/float/str conversions, `io/print_str` — but **no comparison operator at all**: no `gt`/`lt`/`le`/`ge`/`eq`/`ne`/`compare`, and no `Ordering`/`Bool` surface. Those live in `examples/prelude.ail` (the `Eq`/`Ord` classes and the free helpers `lt`/`gt`/`le`/`ge`/`ne`, plus `compare` returning the `Ordering` ADT). A consumer who scans the obvious discovery command never finds half the comparison stdlib — the discovery surface does not point at the library where comparisons live. **Impact.** Surfaced in the cross-model authoring experiment: a frontier model (Claude), given the `ail builtins` scan, still could not find how to compare two Ints; only scanning the prelude *source* revealed `compare`/`gt`. A weaker model never recovers. **Suggested fix.** Have `ail builtins` also list (or cross-reference) the prelude exported `Ord`/`Eq` surface with signatures, or add a discovery command that surfaces the prelude public functions. The discovery tool should be a complete API scan. Evidence: `experiments/2026-05-12-cross-model-authoring/familiar-vs-unfamiliar/` and the "Is AILang harder for a frontier model" section of `experiments/2026-05-12-cross-model-authoring/format-findings.md`.
Brummel added the bug label 2026-06-02 22:23:28 +02:00
Sign in to join this conversation.