feat(treesitter): add native C runtime and 18-grammar compilation bridge - #143
Merged
Conversation
- Vendor modern Tree-sitter C runtime header and Go build tool (build_grammars.go) - Support parallel static compilation of 18 native grammars into libdiffmantic_grammars.a - Add Renovate configuration and GitHub Actions caching for native grammars - Replace Dependabot with Renovate for automated grammar version bumps
golangci-lint fmt walks ./... on the filesystem regardless of .gitignore. The grammars-native build step clones vendored grammar repos into native/bridge/grammars/ before the fmt step runs, so their Go example files were getting caught and failing the format diff check. Add --exclude-dirs native/bridge/grammars to skip those cloned files.
HarshK97
force-pushed
the
feat/native-treesitter-c-runtime
branch
3 times, most recently
from
September 6, 2026 13:59
c2d6d04 to
f3fc744
Compare
In golangci-lint v2, linters and formatters have separate exclusion blocks. Added linters.exclusions.paths and formatters.exclusions.paths to skip native/bridge/grammars, which is populated at build time by cloning vendored grammar repos and is not tracked by git.
HarshK97
force-pushed
the
feat/native-treesitter-c-runtime
branch
from
September 6, 2026 14:04
f3fc744 to
7629e4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
What Changed
native/bridge/src/bridge.c,native/bridge/include/bridge.h) that parses source code and traverses the Tree-sitter CST directly in C, returning a contiguous flat array to Go in a single call.native/bridge/build_grammars.goto fetch, configure, and compile Tree-sitter core and all 18 supported grammars in parallel into a single staticlibdiffmantic_grammars.a.native/bridge/src/registry.cto map language identifiers to their native grammar entry points.native/bridge/grammars.jsonto lock upstream Tree-sitter and grammar releases to explicit tags..github/renovate.json5) with a regex manager to track upstream grammar releases, replacing Dependabot..github/workflows/ci.ymland added thegrammars-nativetarget toMakefile.