Skip to content

Publish runtime docs - #100

Merged
liufengyun merged 6 commits into
tweak-docsfrom
publish-runtime-docs
Aug 25, 2026
Merged

Publish runtime docs#100
liufengyun merged 6 commits into
tweak-docsfrom
publish-runtime-docs

Conversation

@liufengyun

Copy link
Copy Markdown
Contributor

Publish runtime docs

Summary

  • Publish runtime docs
  • Auto import jo.* even with --no-stdlib

Checklist

  • Added / updated tests under tests/pos/ or tests/warn/
  • Docs updated if the change affects user-visible behavior
  • All commits are signed off (why?)
How to sign off commits

Use git commit -s to add the Signed-off-by line automatically:

To add a sign-off to the last commit retroactively:

git commit --amend -s --no-edit

To add sign-off to the last 3 commits:

git rebase --signoff HEAD~3

Security impact

No

Compatibility impact

No

  • Source compatibility: existing code continue to compile
  • SAST compatibility
    • forward compatibility: new libraries can be used by old compiler
    • backward comopatibility: old libraries can be used by new compiler
  • Standard Library compatibility:
    • forward compatibility: new code can work with old stdlib
    • backward compatibility: old code work with the new stdlib
  • Runtime Library compatibility:
    • forward compatibility: new code can work with old runtime
    • backward compatibility: old code work with the new runtime
  • Build tool
    • Build spec compatibility: old projects continue to build
    • Joy package compatibility: old .joy can be consumed by new build tool

liufengyun and others added 2 commits August 24, 2026 17:52
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
@liufengyun
liufengyun changed the base branch from main to tweak-docs August 24, 2026 16:22
liufengyun and others added 2 commits August 24, 2026 20:01
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
@liufengyun
liufengyun requested a review from everdance August 24, 2026 18:06
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Comment thread lib/README.md Outdated
Comment thread lib/README.md Outdated
Comment thread lib/README.md Outdated
Comment thread lib/README.md Outdated
Comment thread lib/README.md Outdated

@everdance everdance left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check comments

Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
@liufengyun
liufengyun merged commit 3a0f058 into main Aug 25, 2026
1 check passed
@liufengyun
liufengyun deleted the publish-runtime-docs branch August 25, 2026 13:42
@liufengyun liufengyun mentioned this pull request Aug 25, 2026
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants