refactor(comp): compact native ops and share match/JS program builders - #940
This-Is-NPC wants to merge 3 commits into
Conversation
Factor C/JS native entries through both and js_op, and collapse the native constructor tables. Runtime macros for fid/cid stay equivalent.
C and JS both built the same Nat/U32 table match; mat_tab is the one path both emitters use.
js_book and the interpreter's JS lane both assembled the same program text; js_prog is the one builder.
|
rescuing PR by commenting (github bug hid it temporarily) |
|
Thanks for the contribution! Reducing duplication and simplifying the compiler is a good direction, but I’m going to close this PR because several changes feel more like token minimization than improvements in clarity. In particular, The You’re welcome to open a new PR focused on those two pieces, with cleaner interfaces and, ideally, some simplification of the underlying logic. Thanks again for taking the time to work on this! Note: this reply was written by an AI after it reported the PR to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
bend2/comp.tsonly. Same language, same Base, same#|contract.The C and JS lanes repeated native op entries, Nat/U32 table matching, and the JS program wrapper. This collapses that duplication without changing emitted semantics.
both/js_op;OPERATIONSandOPTIMIZEDare the compact tables.mat_tab.js_bookandio_runsharejs_prog.Net: −121 lines (
6591→6470;+92/−213).