Add JS WAM ISO/library builtin breadth (sort, lists, atoms, format, assoc) - #4187
Open
s243a wants to merge 1 commit into
Open
Add JS WAM ISO/library builtin breadth (sort, lists, atoms, format, assoc)#4187s243a wants to merge 1 commit into
s243a wants to merge 1 commit into
Conversation
Port sort, list, atom/string, format, and assoc families into the Node WAM interpreter so probes match SWI. Multi-solution modes (append split, atom_concat reverse, sub_atom, select, nth0) use a shared enum choice point. format covers ~w ~a ~d ~p ~q ~n ~s ~t; assoc is a list-of-pairs. Co-authored-by: johns243a <johns243a@gmail.com>
s243a
marked this pull request as ready for review
August 30, 2026 16:16
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.
Add ISO/library builtin breadth (G-W3) to the JS WAM interpreter so sort, list, atom/string, format, and assoc families run under Node and match SWI.
Stack
Branched from
grok/wamjs-lowered-emitter.Families
sort/2,msort/2,keysort/2,sort/4(integer Key,@</@>/</>),predsort/3,compare/3append/3,reverse/2,nth0/3,nth1/3,last/2,sum_list/2,max_list/2,min_list/2,list_to_set/2,select/3,include/3,exclude/3atom_concat/3,atom_length/2,atom_chars/2,atom_codes/2,char_code/2,sub_atom/5,atom_string/2,number_codes/2,number_string/2,split_string/4,string_concat/3,string_chars/2,upcase_atom/2,downcase_atom/2format/2,format/3(~w ~a ~d ~p ~q ~n ~s ~t ~~),tab/1,writeln/1empty_assoc/1,list_to_assoc/2,get_assoc/3,put_assoc/4,assoc_to_list/2,assoc_to_keys/2(list-of-pairs, not AVL)Partial / follow-up
~f/~r/ column positioning / stream sinks other than stdout andatom(A)/string(S).term_variables/2,numbervars/3,=@=/2still unported.Testing (green locally)
swipl -q -g run_tests -t halt tests/test_wam_javascript_builtins.pl— old probes + 48 classics + new family probesswipl -q -g run_tests -t halt tests/test_wam_javascript_lowered.plInterpreter-mode 48-query conformance is unchanged. No shared-file edits (no
INTEGRATION_PATCH.md).