Remix.run Logo
GolDDranks a day ago

It's a Rust library (comprised of a bunch of crates) that wraps a high-performance, high-accuracy syntax highlighter (called Tree-sitter) with vetted support for almost 100 programming/markup languages.

You can use it as a normal Rust library, or you can use the JavaScript/WASM wrapper to highlight source code on a web page.

oersted a day ago | parent | next [-]

> high-accuracy syntax highlighter (called Tree-sitter)

Just wanted to note that tree-sitter is lower-level and more general: it's an incremental parser that is specialised for gracefully and efficiently parsing partially-correct code snippets or code being edited live.

It's an important building block of the highlighter, but it needs more on top to complete the package. It can be used for anything that requires awareness of code structure in an editor.

debugnik 18 hours ago | parent | next [-]

If only it were usable for really-correct parsing. In my experience error recovery is so aggressive it will accept broken ASTs without marking any node as an error. Plus, you can't really solve some ambiguities without C-based lexer hacks.

I wonder if targeting the Tree-sitter ABI directly could be a viable way to write more accurate parsers in an actual programming language while piggybacking on the ecosystem. Could tree-sitter's runtime ABI be adapted for GLL parsers instead of GLR? I haven't looked deep into it yet.

conartist6 16 hours ago | parent [-]

Now you're in my wheelhouse! Come check out https://github.com/bablr-lang/. I'm gearing up for a big release announcement here once I fix these bugs and ship all the latest code.

GolDDranks a day ago | parent | prev [-]

Thanks for the correction!

gorjusborg 17 hours ago | parent | prev [-]

Is the 'regex hater club' subtitle related to using regex to 'parse' rather than using something like tree-sitter that actually parses?

I also had a hard time understanding the context given just the link.