Hacker News new | past | comments | ask | show | jobs | submit login

So... You write your grammars in Javascript. Which is then serialized to JSON but a parser defined in Rust, so that it can be compiled to C?..

That’s... a very roundabout way of doing things.

http://tree-sitter.github.io/tree-sitter/implementation






Many parser generation tools use their own custom grammar language, and then generate a C parser based on that. With Tree-sitter, it’s a similar setup, except the grammars are written in JavaScript instead of some custom language.

The parser generator itself is all written in Rust, but the end user doesn’t need to use rust in any way.


I asked[1] recently if it's possible to remove the need of the whole NodeJS. The conclusion is that it might be possible to use duktape instead.

[1] https://github.com/tree-sitter/tree-sitter/issues/465




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: