Publish runtime docs - #100
Merged
Merged
Conversation
Whether the standard library is in scope was tied to whether `.sast` libraries were loaded. `Typer.check` branched on `libs.isEmpty` to decide two unrelated things: which libraries to load, and whether to name units in a scope with `jo` opened. Compiling with libraries got `jo`; compiling the stdlib from source did not. That conflation is why a file in a nested namespace could not see the stdlib under `--no-stdlib`. Files in `lib/mutable`, `lib/regex` and `lib/resource` carried `import jo.*` purely to work around it, and the runtime FFI libraries could not be compiled that way at all: `--no-star-import` is set for runtime code, so `import jo.*` is rejected there, and the one type they still need -- the vararg `..` -- has no spelling that an import can name. Untangle the two. `Namer.transform` no longer takes a scope; it builds the prelude itself, resolving `jo` from the root name table at the point of use. That has to be lazy: when the stdlib is what is being compiled, `jo` does not exist as the loop starts -- `resolveNamespace` is what creates it. Nothing reads a name through the prelude before then, since imports run in `delayedImports` and bodies in `delayedUnits`, both after every unit has been indexed, and the prelude holds `jo`'s name table by reference so members registered later stay visible. The prelude keeps the two-level shape the old `joScope` had, a nested scope over the root: `jo` itself and every user-level namespace live in the root table, so collapsing them loses `jo.mutable.List` and cross-namespace references alike. Drop the eight now-redundant `import jo.*` lines in `lib/`. They only ever documented a requirement that no longer exists, and removing them is what demonstrates the fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Axxvi5T1CsUjJ8zjZit8Q
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
The released bundle documented `jo` only, so `jo.py`, `jo.rb` and `jo.js` never reached readers -- including the warning at the top of `py.jo` not to enable a runtime API when compiling untrusted code. That surface is the one place a program can leave the confined world, so it is the last thing that should be undocumented. Add the three FFI sources to the release command in RELEASE.md and to the doc check in `ci`. Only `py.jo`, `rb.jo` and `js.jo` are listed: the rest of each `runtime/` directory is backend plumbing rather than API. They can be compiled in the same pass as the stdlib sources now that `--no-stdlib` no longer suppresses the `jo` prelude. Before that they resolved nothing under that flag, and neither workaround was open to them -- runtime code is built with `--no-star-import`, and the vararg `..` has no spelling an import can name. `ci` now shares one `DOC_SOURCES` list between its two doc commands so they cannot drift apart, and passes `--readme` as the release does. Without it a home page that breaks the generator, or markdown that mangles the inline SVG, would only surface while cutting a release. The bundle goes from 5 namespaces to 8, and from 437 search entries to 610. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Axxvi5T1CsUjJ8zjZit8Q
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
everdance
reviewed
Aug 25, 2026
everdance
reviewed
Aug 25, 2026
everdance
reviewed
Aug 25, 2026
everdance
reviewed
Aug 25, 2026
everdance
reviewed
Aug 25, 2026
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
everdance
approved these changes
Aug 25, 2026
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.
Publish runtime docs
Summary
jo.*even with--no-stdlibChecklist
Added / updated tests undertests/pos/ortests/warn/How to sign off commits
Use
git commit -sto add theSigned-off-byline automatically:To add a sign-off to the last commit retroactively:
To add sign-off to the last 3 commits:
Security impact
No
Compatibility impact
No