docs: refresh user-facing docs for v0.11.2 features#8
Merged
Conversation
The reference was missing roughly half the standard library and the
shape of the surviving entries had drifted from the engine. Bring it
back into line with SPEC.md as of 0.11.2.
Adds entries for take, drop, at, lst, uniqby, zip, enumerate, range,
chunks, window, cumsum, frq, flatmap, partition, plus the stats /
linalg / set / FFT families, the text-case + padding + regex helpers,
chars / ord / chr, datetime, JSONL, get-many, sleep, fmt2, rsrt, and
the full transcendental math suite.
Map keys are now typed (text or integer) with float keys flooring at
the builtin boundary; documented inline with an example showing
Int(7) and Text("7") as distinct keys.
slc / take / drop accept negative indices counting from the end with
clamp-on-overflow.
Adds the !! panic-unwrap operator alongside ! in the auto-unwrap
section, with the same R/O callee shape but no constraint on the
enclosing return type, so main>t scripts can use it.
Adds an Inline lambdas subsection showing the (params>ret;body)
literal as an HOF argument, including closure capture from the
enclosing scope.
! propagates errors via the enclosing function's return type, which means scripts and one-shot main entry points have to wrap everything in >R t t and emit ~v just to bail on a missing file. !! is the symmetric form that aborts the program with a runtime diagnostic and exit 1 on ^e / nil, with no constraint on the enclosing return type. Same R/O callee shape as !; pick !! when failure is a programming or environmental error the caller cannot recover from.
…line lambdas
slc / at / take / drop accept Python-style negative indices counting
from the end with clamp-on-overflow. Documents the common idioms
(slc xs 0 -1 to drop the last, slc xs -2 (len xs) to keep the last
two, take -1 / drop -1, etc.) inline with the slc section.
Map keys are typed: text or integer. Int(1) and Text("1") are
distinct, so an index lookup map can use numeric keys directly
without an str j tax on every iteration.
Inline lambdas (params>ret;body) can be passed directly to any HOF
in place of a one-off helper decl, including with closure capture
from the enclosing scope.
The AOT compilation section claimed numeric-only scope, but ilo compile now matches the Cranelift JIT surface, which is the whole language minus closure capture. Update the disclaimer accordingly. Add a Top-level program output section to the CLI reference covering the stdout / stderr / exit-code split for ~v / ^e / non-Result returns. Calls out that the contract holds byte-for-byte across in-process runners and AOT-compiled binaries — output is identical whether you ilo run or ilo compile && ./binary.
…refresh # Conflicts: # src/content/docs/docs/reference/builtins.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The user-facing site had drifted behind the main repo. Roughly half the standard library was missing from the builtin reference, the AOT scope claim was multiple versions stale, and several v0.11.x features (negative indices, typed map keys,
!!panic-unwrap, inline lambdas) weren't documented anywhere on the public site. This PR catches the site up to v0.11.2 and aligns it with the SPEC drift fix in ilo/pull/290.What's in the diff
reference/builtins.md— full refreshRoughly half the standard library was missing. Adds entries for
take,drop,at,lst,uniqby,zip,enumerate,range,chunks,window,cumsum,frq,flatmap,partition, plus the stats / linalg / set / FFT families, the text-case + padding + regex helpers,chars/ord/chr, datetime, JSONL,get-many,sleep,fmt2,rsrt, and the full transcendental math suite (sqrt,pow,exp,log,log10,log2,sin,cos,tan,atan2). Map section rewritten for typed keys.slc/take/dropentries note negative-index semantics. New Inline lambdas subsection.!!added alongside!in the auto-unwrap section.guide/error-handling.md— add!!panic-unwrapDocuments the symmetric panic-unwrap that aborts the program with a runtime diagnostic and exit 1 on
^e/nil. Same R/O callee shape as!, no constraint on the enclosing return type, somain>tscripts can use it directly.guide/collections.md— feature pickupsNegative indices on
slc/at/take/dropwith the common idioms (slc xs 0 -1to drop the last,slc xs -2 (len xs)to keep the last two, etc.). Map keys are typed (text or integer), with the integer-key idiom inline. New Inline lambdas subsection showing closure capture.reference/cli.md— AOT parity + top-level output contractThe AOT scope claim was numeric-only-arithmetic-loops. AOT now matches the Cranelift JIT surface — the whole language minus closure capture. New Top-level program output section covers the stdout / stderr / exit-code split for
~v/^e/ non-Result returns, and calls out that the contract holds byte-for-byte across in-process runners and AOT binaries.Test plan
npm run buildclean (30 pages built, no broken links)SPEC.mdandexamples/in the main repoOut of scope
SPEC.md. The site is for users; engine choice is a CLI flag, not a language feature.index.astro,manifesto.md) didn't have stale feature claims, so they're untouched.