lib-ruby-parser
Contents
- Intro
- Implementation
- Future improvements
- C bindings
- Cpp bindings
- Node bindings
- WASM
- Final thoughts
Intro
So, I’m ready to announce that I’ve finished working on a new Ruby parser. It’s called lib-ruby-parser
.
Key features:
- It’s fast. It’s written in Rust and it’s slightly faster than Ripper. The difference is about 1-2% on my machine.
- It has a beautiful interface. Every single node has its own type that is documented. For example, take a look at CSend node that represents “conditional send” like
foo&.bar
. Here’s a list of all defined nodes. Both Ripper and RubyVM::AST have no documentation of their AST format.whitequark/parser
has a great documentation, but its AST is not “static”. - What’s “static AST”? By saying that I mean that if documentation says that “N is not-nullable” then it’s true no matter what.
whitequark/parser
does a great job, but the nature of dynamic...