-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce lexer #99
Comments
This points to a possibly faster approach: https://www.reddit.com/r/rust/comments/b8gha1/javascript_lexing_for_high_performance_in_rust/ |
new rustc lexer is very similar to what I've been exploring - https://github.com/rust-lang/rust/blob/e2b4165a6c2fbab4c1bde97d0c2e47b4602f7bc0/src/librustc_lexer/src/lib.rs |
I got to the point where I have a lexer branch ( The performance is promising:
This is what I'd call a lower bound of what I think is possible. This is a pretty dummy and dirty lexer which doesn't have any peeking, keeps stack and does many other things that I think we can avoid. I'm going to continue toying with a lexer for the forseeable future as it's not a blocker for any work, but I like tinkering with it in my spare time. My hope is to get |
I will try to do some experiments in the next few days and try to achieve faster perf win. |
great! here's my last attempt - https://github.com/zbraniecki/fluent-rs/tree/lexer5 |
At this point, I don't believe we should be trying to add a lexer. The Parser is Really Fast, and if someone can come up with a significant performance improvement, that should be a separate issue filed by the person who's able to make that PR :) @Stupremee - please, open a issue/PR if you get to it! |
In case we revisit - https://github.com/maciejhirsz/logos |
In my early experiments, lexer seems to have a very nice perf impact on parsing.
I'll investigate more, but if someone gets to it first, feel free to take it!
A good background read - https://medium.com/@retep007/javascript-lexing-for-high-performance-f9a800ec930d
The text was updated successfully, but these errors were encountered: