Cross-compiled tree-sitter native libraries for all major desktop platforms + WASM, with all officially supported language grammars bundled into a single monolithic library.
| Platform | Static (.a/.lib) | Shared (.so/.dylib/.dll) |
|---|---|---|
| Linux x86_64 | ✓ | ✓ |
| Linux aarch64 | ✓ | ✓ |
| macOS x86_64 | ✓ | ✓ |
| macOS aarch64 | ✓ | ✓ |
| Windows x86_64 | ✓ | ✓ |
| Windows aarch64 | ✓ | ✓ |
| WASM (web-tree-sitter) | — | ✓ |
Bash, C, C++, C#, CSS, Go, HTML, Java, JavaScript, JSON, Markdown, Python, Regex, Ruby, Rust, Scala, SQL, TOML, TypeScript, YAML
CMake, Dockerfile, Elixir, Erlang, Haskell, Julia, Kotlin, Lua, Make, OCaml, PHP, R, Swift, Vim, XML, Zig
Each tagged release publishes:
| Archive | Contents |
|---|---|
tree-sitter-<platform>.tar.gz |
libtree_sitter_all.{a,so,dylib} or .lib/.dll |
tree-sitter-wasm.tar.gz |
tree-sitter.js, tree-sitter.wasm, grammars/*.wasm |
tree-sitter-queries.tar.gz |
Per-language highlights.scm, locals.scm, etc. |
These archives are consumed by a downstream Scala provider module that embeds them into fat JARs via sbt-multi-arch-release, enabling tree-sitter usage from:
- JVM — via Project Panama FFM (shared libraries)
- Scala Native — via
@externlinking (static libraries) - Scala.js — via web-tree-sitter facades (WASM)
- Rust (stable)
- zig + cargo-zigbuild (Linux cross-compilation)
- cargo-xwin (Windows cross-compilation)
- Node.js + npm (WASM builds)
- Emscripten SDK (WASM grammar compilation)
- tree-sitter CLI (
npm install -g tree-sitter-cli)
cargo build --release --manifest-path native/Cargo.tomlscripts/cross-all.shscripts/build-wasm.sh
scripts/collect-queries.sh- Add the crate dependency to
native/tree-sitter-all/Cargo.toml - Add the
export_grammar!line tonative/tree-sitter-all/src/lib.rs - Add the grammar name to the
GRAMMARSarray inscripts/build-wasm.sh - Add the grammar name to the
GRAMMARSarray inscripts/collect-queries.sh - Update the grammar count in
ts_natives_grammar_count() - Update this README
Apache-2.0