lady-deirdre
crafting-interpreters-rs
lady-deirdre | crafting-interpreters-rs | |
---|---|---|
1 | 1 | |
70 | 231 | |
- | - | |
5.2 | 0.0 | |
about 1 month ago | over 1 year ago | |
Rust | Rust | |
- | Boost Software License 1.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
lady-deirdre
-
Why Split Lexing and Parsing into Two Separate Phases?
Well, my personal experience was in the opposite direction actually.
I used to use combinators-based approach without Lex/Syn separation (aka PEGs) for a long time. But then I came up to understanding that the separation approach is actually better in performance. And also that working and debugging of the Token sequences while writing parser manually is just more handy (at least for me).
But this is my personal experience of course. I do believe too that it all depends on the goal, and parsers micro-optimizations is not that much critical in many cases, and that combinators approach actually works quite well too.
As of Nom, I can say that it works quite well. But I think that the it's performance gains stem from the fact that Rust is a systems-based PL, and it optimizes function combinations just better than, let say, JavaScript or Python.
In my incremental parsers library Lady Deirdre I utilize Lex/Syn separation, and the LL(1) recursive-descend parsing, and it shows much better performance than in Tree-Sitter at least on relatively big files [1].
[1] https://github.com/Eliah-Lakhin/lady-deirdre/tree/master/wor...
crafting-interpreters-rs
What are some alternatives?
comemo - Incremental computation through constrained memoization.
cranelift-jit-demo - JIT compiler and runtime for a toy language, using Cranelift
slang-v2 - Simple scripting language interpreter
blip - a programming language
lineiform - A meta-JIT library for Rust interpreters
clojurust - A proof of concept version of Clojure in Rust.
lexgen - A fully-featured lexer generator, implemented as a proc macro
RustPython - A Python Interpreter written in Rust