What is gotreesitter?
maingotreesitter is a pure-Go implementation of the tree-sitter runtime. Unlike traditional Go bindings that rely on CGo, gotreesitter implements the parser, lexer, query engine, incremental reparsing, arena allocator, external scanners, and tree cursor entirely in Go.
Key features:
- No CGo dependency: Eliminates the need for a C toolchain or cross-compilers.
- Cross-compilation support: Works with any
GOOS/GOARCHtarget supported by Go (e.g.,wasip1). - Grammar Loading: It uses the same parse-table format as the C runtime. Grammars are extracted from upstream
parser.cfiles viats2go, compressed into binary blobs, and deserialized on first use. The registry includes 206 grammars.