jsparagus is intended to replace the JavaScript parser in Firefox.
Current status:
-
jsparagus is not on crates.io yet. The AST design is not stable enough. We do have a build of the JS shell that includes jsparagus as an option (falling back on C++ for features jsparagus doesn't support). See mozilla-spidermonkey/rust-frontend.
-
It can parse a lot of JS scripts, and will eventually be able to parse everything. See the current limitations below, or our GitHub issues.
-
Our immediate goal is to support parsing everything in Mozilla's JS test suite and the features in test262 that Firefox already supports.
Join us on Discord: https://discord.gg/tUFFk9Y
make init
make all
(Note: This takes about 3 minutes to run on my laptop. Part of jsparagus is generated by a Python script, and the script is pretty slow. We're working on it!)
When it's done, you can:
-
Run
make check
to make sure things are working. -
cd crates/driver && cargo run
to test the JS parser and bytecode emitter.
It's all limitations, but I'll try to list the ones that are relevant to parsing JS.
-
Lookahead assertions are limited to one token. (The JS grammar contains an occasional
[lookahead != `let [`]
and even[lookahead != `async [no LineTerminator here] function`]
.) -
Error messages are poor.
-
No table compaction or table optimization. There's plenty of low-hanging fruit there.