Compile cli_args.pl through the JS WAM (A2) - #4208
Open
s243a wants to merge 3 commits into
Open
Conversation
Checked out from claude/peerhailer-exploratory-docs-aodas5. Top-level reference and harness stay verbatim for the A2 JS-WAM compile. Co-authored-by: johns243a <johns243a@gmail.com>
Interpreter-tier project under examples/cli_args/wamjs/, thin ESM shim, oracle corpus + differential runner. Runtime: sub_string/5, Y-save across Call, Execute-to-builtin proceeds to CP. Probes for each gap. Co-authored-by: johns243a <johns243a@gmail.com>
Zero divergences vs the JS oracle; wamjs 4.639s vs oracle 0.048s. Co-authored-by: johns243a <johns243a@gmail.com>
s243a
marked this pull request as ready for review
September 1, 2026 01:55
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.
Compile the frozen A1 peerhailer argparser (
examples/cli_args/cli_args.pl) with thewam_javascriptinterpreter target and hold it to the same oracle bar as A1.What
examples/cli_args/(oracle, harness, patternjs) fromclaude/peerhailer-exploratory-docs-aodas5. Top-level reference files are verbatim.examples/cli_args/wamjs/:build.shregeneratesjs/fromcli_args.pl; ESM shimcliArgs.mjsexportsparseArgs/CliError(term conversion only); corpus copycliArgs.wamjs.test.mjs;diff_runner_wamjs.mjs+run_differential_wamjs.sh.Runtime gaps this program forced
sub_string/5—starts_with/2and substring helpers call it; no user label, so the interpreter must implement the builtin (V.StringSub). Probe:probe_sub_string/0.Call—default_registry/1is a huge ground fact (GetList/Unify*, noAllocate) and was clobbering the caller’s Y (includingResult).Callsnapshots Y;Proceedrestores. Probe:probe_y_preserve/0.Executeof a builtin must Proceed, not halt — helpers such assubstring_from/3end withDeallocate+Execute sub_string/5. Halting dropped the rest ofparse_args/3. Probe:probe_tail_builtin/0.The shim implements no parse rule.
/3custom registries are converted at the edge; the 17-test corpus only uses/2+ the default registry.Acceptance (measured)
bash examples/cli_args/wamjs/build.shregeneratesjs/node --test examples/cli_args/wamjs/cliArgs.wamjs.test.mjs→ 17/17tests/test_wam_javascript_builtins.pl(incl. the three new probes), lowered, fact-sources, andCONFORMANCE_TARGETS=javascript→ greenDoes not edit
core/target_registry.pl, the conformance harness,wam_target.pl, or frozenexamples/cli_args/top-level files.