gotreesitter: Pure Go Implementation of Tree-Sitter Parser Library
By
odvcencio
Slow-proofed and worth the wait. Worth its weight in flour.
Summary
gotreesitter is a pure Go implementation of the tree-sitter parsing library that eliminates CGo dependencies, allowing cross-compilation to any platform Go supports including WebAssembly. The project loads the same parse-table format as the C runtime, extracts grammar tables from upstream parser.c files via ts2go, compresses them into binary blobs, and ships 206 grammars in its registry. The implementation includes the parser, lexer, query engine, incremental reparsing, arena allocator, external scanners, and tree cursor functionality without any C dependencies.
Key quotes
· 4 pulledPure-Go tree-sitter runtime. No CGo, no C toolchain. Cross-compiles to any GOOS/GOARCH target Go supports, including wasip1.
gotreesitter loads the same parse-table format that tree-sitter's C runtime uses. Grammar tables are extracted from upstream parser.c files by ts2go, compressed into binary blobs, and deserialized on first use.
Every Go tree-sitter binding in the ecosystem depends on CGo: gotreesitter eliminates the C dependency entirely.
The parser, lexer, query engine, incremental reparsing, arena allocator, external scanners, and tree cursor functionality are implemented in pure Go.
You might also wanna read
Zig Devlog: Build System Rework Separates Maker and Configurer Processes
This devlog entry from the Zig programming language project announces a major rework of the build system, separating the maker process from
magiblot/tvision: A modern cross-platform port of Turbo Vision 2.0 with Unicode support
A modern, cross-platform port of Turbo Vision 2.0, the classical framework for text-based user interfaces (TUI). Originally started as a per
Why a Software Maintainer is Rejecting External Pull Requests
The article is a personal reflection from a software maintainer explaining why they are rejecting pull requests (PRs) from external contribu
GitHub Repository: Chip8 Emulator Project for Virtual Machine Emulation
The article appears to be a GitHub repository page for a Chip8 emulator project called 'navid-m/chip8emu'. The content shows GitHub's interf
10-year-old unit test with future cookie expiry date breaks Servo browser CI system
A developer shares a story about a unit test written 10 years ago for the Servo browser engine that included a cookie expiry date of April 1
Servo Browser Engine Releases First crates.io Version as Embeddable Library
Servo, the web browser engine written in Rust, has released its first crates.io version (v0.1.0), making it available as a library for devel
