https://github.com/zbraniecki/jsparagus-ftl
An FTL experiment for JSParagus
https://github.com/zbraniecki/jsparagus-ftl
Last synced: 2 months ago
JSON representation
An FTL experiment for JSParagus
- Host: GitHub
- URL: https://github.com/zbraniecki/jsparagus-ftl
- Owner: zbraniecki
- Created: 2020-02-26T23:46:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-27T00:06:38.000Z (over 6 years ago)
- Last Synced: 2025-08-18T21:35:19.370Z (10 months ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Synopsis
This is an experiment of using `fluent-rs` lexer branch approach to parsing JavaScript.
It uses lexer/parser combo, mostly to improve the debugging experience and simplify the
tokenization phase.
The appoach is very POC level. Some decisions were made that will have to be revisited like
using `Peekable` which makes the `Lexer` opaque. Instead, we could implement peeking inside of `Lexer`
just like `fluent-rs` does, and then get access to custom methods on the `Lexer` like `take_if` etc.
The Lexer is also stateless which won't likely cut it, and `fluent-rs` lexer is statefull, so we could adopt that once
needed.
Generally speaking tho, this performance should be similar, for the given `simple` script,
to what we could end up with for the runtime scenario.
# Usage
```
cargo run --bin lexer ./benches/simple.js
cargo run --bin parser ./benches/simple.js
cargo run --bin lexer ./benches/complex.js
cargo run --bin parser ./benches/complex.js
cargo bench lexer
cargo bench parser
cargo bench simple
cargo bench complex
```