Question: difference between Lezer and tree-sitter

Hi I am quite new to Lezer. Maybe this is documented somewhere but I cannot find: what’s different about Lezer that makes it more suitable for Codemirror6 than tree-sitter? (I can see tree-sitter is still a very active project, and it can produce parser in wasm format to run inside browser.)

Lezer was very much inspired by tree-sitter, but rewritten to run in JavaScript (more browser support, less data marshalling than wasm) and to be more compact (in code size, grammar size, and tree memory consumption) to more closely fit the web-site use case.

2 Likes

Thx! That’s a nice paragraph to be added to the documentation BTW.

Good idea. Done in Clarify difference from tree-sitter a bit more in the guide · lezer-parser/website@db9efdc · GitHub

1 Like

@3cp see also Lezer blog post with lots of interesting background.

2 Likes