Skip to content

chore: remove the unmaintained pure-JS lexer port - #204

Open
BridgeAR wants to merge 2 commits into
guybedford:v3from
BridgeAR:BridgeAR/2026-06-22-remove-js-port
Open

chore: remove the unmaintained pure-JS lexer port#204
BridgeAR wants to merge 2 commits into
guybedford:v3from
BridgeAR:BridgeAR/2026-06-22-remove-js-port

Conversation

@BridgeAR

Copy link
Copy Markdown
Contributor

Summary

Removes the hand-written pure-JS lexer.js - a manual reimplementation of the WebAssembly lexer that had to be kept in sync by hand. It is unreachable through the package exports (. -> wasm, ./js -> asm.js) and is not run by chomp test, so it could drift silently with no consumer. The asm.js build already covers the no-WebAssembly case.

The unit harness now defaults to the wasm build, and the if (!js) skips become unconditional - they already ran under wasm and asm.

Test plan

  • chomp test (wasm + asm): 132 passing on both.

@BridgeAR
BridgeAR marked this pull request as ready for review June 22, 2026 11:22
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-06-22-remove-js-port branch 3 times, most recently from d48ab30 to 2a644d1 Compare July 1, 2026 17:29
@guybedford guybedford added this to the 3.0.0 milestone Jul 12, 2026
* perf(lexer): skip identifier and number runs

On the 3,057 KiB sample corpus, Wasm drops from 15,356.31 to 13,010.46 us per sweep on Node 18.20.8 (-15.28%) and from 11,724.34 to 9,856.69 us on Node 24.18.0 (-15.93%). The asm.js build drops from 15,934.34 to 12,945.57 us on Node 24.18.0 (-18.76%).

The fast path adds 379 raw / 105 gzip bytes to the full Wasm binary. Measurements used 1,500 warmup sweeps followed by 9 interleaved trials of 50 sweeps, dropping the best and worst trials.
@BridgeAR
BridgeAR changed the base branch from main to v3 July 22, 2026 10:14
lexer.js reimplemented the WebAssembly lexer in hand-written JS, kept in sync
by hand, but was unreachable through the package `exports` (only `.` and
`./js` are exposed - the wasm and asm.js builds) and `chomp test` never ran
it, so it could drift silently. The asm.js build already covers the
no-WebAssembly case, and the removed `if (!js)` test guards now run
unconditionally, matching their existing behavior under the wasm and asm
suites.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-06-22-remove-js-port branch from 2a644d1 to 296006d Compare August 2, 2026 14:31
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