Top
Best
New

Posted by zdw 12/15/2025

Arborium: Tree-sitter code highlighting with Native and WASM targets(arborium.bearcove.eu)
230 points | 45 commentspage 2
divyeshio 12/15/2025|
This is cool! How does it compares with Shiki or Highlighter.js in terms of performance?
pornel 12/15/2025||
There's also a pure-Rust implementation of a syntax highlighter, which uses TextMate/SublimeText grammars: https://lib.rs/syntect
zeon256 12/15/2025|
Tree-sitter produces more accurate highlighting tho. We used syntect for our web editing cos it’s faster (and lighter in terms of size) and tree-sitter for rendered pages in our company and the difference is stark
f311a 12/15/2025||
I had to wait for about 10 seconds for it to load on my crappy mobile connection.

They also load 1 mb of fonts. In total, this page is close to 3 mb.

Also, when you select a language, the grammar file gets downloaded twice.

teo_zero 12/15/2025||
Sorry, but I can't understand what this actually is. A library, a stand-alone tool, a Rust crate? What users does it target? Text editors, website creators?
GolDDranks 12/15/2025||
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 12/15/2025|||
> 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 12/15/2025|||
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 12/15/2025||
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 12/15/2025|||
Thanks for the correction!
gorjusborg 12/15/2025|||
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.

joshka 12/15/2025|||
See https://fasterthanli.me/articles/my-gift-to-the-rust-docs-te...
jasonjmcghee 12/15/2025|||
GitHub repo is a bit more helpful, but users or building of text editors that use tree-sitter.

Or... website text editors which historically have had imperfect syntax highlighting.

Notice the Zed sponsorship.

https://github.com/bearcove/arborium

tombh 12/15/2025||
> Batteries-included tree-sitter grammar collection with HTML rendering and WASM support.

That's the best one sentence description there is and it's at the top of the Github README. I think that would fit nice at the top of https://arborium.bearcove.eu too

discord9 12/15/2025|||
I think this gives some context?:https://fasterthanli.me/articles/my-gift-to-the-rust-docs-te... TLDR: for rust doc highlighting stuff in document
Rodmine 12/15/2025||
Not for you then. You don't need to understand everything.
unrealhoang 12/15/2025||
The get started section seems to be broken or missing content.
virajk_31 12/15/2025||
This is cool, was looking for something similar
simonjustice 12/16/2025|
[dead]