An open API service indexing awesome lists of open source software.

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

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
```