feat: JS compile target (--emit js, ES modules)#713
Merged
Conversation
|
Implements ILO-73 MVP: src/codegen/js.rs mirrors python.rs, wires --emit js in CLI, and verifies fac/fib compile to runnable Node.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9c79adb to
9fd99c8
Compare
This was referenced May 22, 2026
danieljohnmorris
added a commit
that referenced
this pull request
May 22, 2026
- Add --emit js / --emit python to CLI invocation section of SPEC.md (PR #713, ILO-73) - Update tokcount entry: native uses tiktoken-rs cl100k_base BPE; WASM falls back to bytes/3.4 stub (PR #716, ILO-413) - Add idxof builtin entry to SPEC.md builtins table (O n, code-point index, 0.13.0) - Mirror all three fixes into skills/ilo/ilo-builtins-text.md - Regenerate ai.txt via cargo build Co-authored-by: Daniel Morris <daniel@cubitts.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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
src/codegen/js.rsmirroringpython.rs— emits ES modules withconst fn = (...args) => { ... }arrow functions--emit jsflag in CLI alongside existing--emit pythonmake-id→makeId)len→.length,abs/min/max/flr/cel→Math.*,str→String(), list spread for append, etc.fac(5)=120,fib(10)=55)Deferred (follow-up tickets)
_iloUnwrapis referenced but not emitted)_typekey, mirrors Python)--emit jsintegration test in the CLI test harnessTest plan
cargo test codegen::js— 12/12 passilo examples/recursion.ilo --emit js | node -e "$(cat); console.log(fac(5), fib(10))"→120 55ilo 'f x:n>n;*x 2' --emit jsproduces valid ES moduleCloses ILO-73
🤖 Generated with Claude Code