Skip to content
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

Good stuff #1

Open
winston0410 opened this issue Mar 16, 2022 · 3 comments
Open

Good stuff #1

winston0410 opened this issue Mar 16, 2022 · 3 comments

Comments

@winston0410
Copy link

Not really a issue, but really appreciate your work. I am being curious, why makes you build a new parser combinator instead of using some existing solution like nom?

@AlienKevin
Copy link
Owner

AlienKevin commented Mar 17, 2022

Thanks! I found libraries like nom to be complicated to work with initially so I decided to write my own parser combinators modeled on elm/parser. Looking back, my parser library is more like an experiment for learning Rust and combinators. I ran some benchmark tests on JSON parsing comparing nom and my library. Mine was like 50x slower even after both are compiled with optimization. Though for parsing words.hk (megabyte level data), the difference is not noticable. wordshk-tools can do a complete parse under several seconds if you compile with optimization. Though without optimization it takes around 10 seconds or more.

@AlienKevin
Copy link
Owner

Also my parser library support Unicode as a first class in both parsing and error messages. You can use graphemes as a unit of parsing, so emojis, Korean script, and other writting systems can be more accurately parsed.

@winston0410
Copy link
Author

Also my parser library support Unicode as a first class in both parsing and error messages. You can use graphemes as a unit of parsing, so emojis, Korean script, and other writting systems can be more accurately parsed.

Yes for nom I have to use a unicode crate for eating unicode characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants