PEG parsing in TypeScript, two ways:
- an AST interpreter (src/tree-walk.ts)
- a switch-based bytecode interpreter (src/switch-interp.ts)
npm test
npm run bench:bun
(for JSC) or npm run bench:node
(V8)
Deopts:
- Ensure Deopt Explorer is is installed in VSCode.
npx tsc && npx dexnode build/scripts/parse.js test/data/jquery-3.2.1.js
- Open the log file (named something like
isolate-0x140078000-55537-v8.log
) in Deopt Explorer.