{"slug": "tree-sitter", "name": "tree-sitter", "category": "dev-libs", "category_name": "Libraries and frameworks", "description": "Incremental parser generator and parsing library for building concrete syntax trees of source code.", "recommenders": 15, "commenters": 30, "warners": 3, "score": 13.408, "rising": -2.25, "first": "2025-11-12", "latest": "2026-10-12", "why": "Liked for syntax highlighting and queries in editors like Emacs and Neovim, for quickly building grammars and error-tolerant parsers for custom languages, and as the parsing layer for AST-based code analysis and agent tools.", "why_is_quote": false, "has_verdict": true, "sentiment": {"recommend": 16, "neutral": 11, "compare": 1, "warn": 3}, "spark": [1, 3, 4, 3, 0, 2, 0, 0, 1, 0, 2, 0], "listed": true, "loved": ["Code analysis tooling", "Grammar authoring"], "caveat": "Indentation languages", "short_quote": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so.", "icon": true, "domain": null, "github_repo": null, "official_url": "https://tree-sitter.github.io/", "pricing": "open source", "aliases": ["tree-sitter", "Tree-sitter"], "verdict": [{"text": "Liked for syntax highlighting and queries in editors like Emacs and Neovim,", "cites": [{"id": 797882881, "item_id": 49867680, "url": "https://news.ycombinator.com/item?id=49867680", "by": "WesolyKubeczek", "date": "2026-09-27", "stance": "recommend", "quote": "I think treesitter runs circles around what classic vim is using to highlight syntax.", "excerpt": "I used neovim because it felt way faster by default. I think treesitter runs circles around what classic vim is using to highlight syntax. That said, I never used both beyond basics, thus no horror stories either.", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "On caring for user data: NeoVim caused Vim undo files to be deleted"}, {"id": 747604449, "item_id": 46725278, "url": "https://news.ycombinator.com/item?id=46725278", "by": "Conscat", "date": "2026-01-22", "stance": "recommend", "quote": "I love how easy it is to write Tree Sitter queries for very special patterns", "excerpt": "I find neither LSP for Tree Sitter sufficient for syntax highlighting, but I am extremely satisfied by my special combination of _both_ in Emacs. I love how easy it is to write Tree Sitter queries for very special patterns, like highlighting namespace declarations differently from scope resolution, or highlighting inline assembly differently from normal strings. But I really want the semantic highlighting from a lang", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 784334259, "item_id": 49020891, "url": "https://news.ycombinator.com/item?id=49020891", "by": "TacticalCoder", "date": "2026-07-23", "stance": "recommend", "quote": "Emacs now with tree-sitter, LSPs, native-compilation, magit", "excerpt": "> IntelliJ (actually Android Studio based on IntelliJ) was my first real IDE and real programming experience. I was so blown away ! I switched to IntelliJ back when people where still arguing which of the two between Eclipse or NetBeans was better (fools!): that is, before some of the commenters here were born. Heck, I bought IntelliJ when the world was ending in the Mayan calendar, it was something like 75% off beca", "context": "", "use_case": "syntax parsing in Emacs", "switched_from": "", "story": "Escape IntelliJ: Scala and Kotlin LSPs on Emacs Eglot"}]}, {"text": " for quickly building grammars and error-tolerant parsers for custom languages,", "cites": [{"id": 740408960, "item_id": 46275560, "url": "https://news.ycombinator.com/item?id=46275560", "by": "danielvaughn", "date": "2025-12-15", "stance": "recommend", "quote": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so.", "excerpt": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so. It's incredibly fun once you get into a flow state. The docs call it a zen-like experience, and that's a perfect way to describe it. It's so, so good.", "context": "", "use_case": "building grammars", "switched_from": "", "story": "Arborium: Tree-sitter code highlighting with Native and WASM targets"}, {"id": 747530320, "item_id": 46720645, "url": "https://news.ycombinator.com/item?id=46720645", "by": "FjordWarden", "date": "2026-01-22", "stance": "recommend", "quote": "the overall DevEx is much quicker that hand-rolling the parser", "excerpt": "This is like the difference between an orange and fruit juice. You can squeeze an orange to extract its juices, but that is not the only thing you can do with it, nor is it the only way to make fruit juice. I use tree-sitter for developing a custom programming language, you still need an extra step to get from CST to AST, but the overall DevEx is much quicker that hand-rolling the parser.", "context": "developing a custom programming language", "use_case": "custom language parsing", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 739507808, "item_id": 46219238, "url": "https://news.ycombinator.com/item?id=46219238", "by": "VonTum", "date": "2025-12-10", "stance": "recommend", "quote": "I just use it as an error-tolerant frontend to my compiler.", "excerpt": "Oh nono, with tree-sitter, you get an untyped syntax tree. That means, you have a Cursor object to walk the tree, which creates Node objects as you traverse, that have a \"kind\" (name of the tree-sitter node), span, and children. (I recommend using the rust tree-sitter bindings itself, not the rust wrapper rust-sitter). Yes, portability like that is a huge benefit, though I personally utilized it for that yet. I just ", "context": "compiler developer", "use_case": "error-tolerant compiler frontend", "switched_from": "", "story": "Revisiting \"Let's Build a Compiler\""}]}, {"text": " and as the parsing layer for AST-based code analysis and agent tools.", "cites": [{"id": 797703793, "item_id": 49856487, "url": "https://news.ycombinator.com/item?id=49856487", "by": "dkn", "date": "2026-09-26", "stance": "recommend", "quote": "building a small pipeline that reads the old code base, parses it file by file using tree sitter", "excerpt": "I have had a ton of success in exposing AST-based tools to agents when working in large, old codebases. Without them, not only do agents get simple things like function call counts wrong, they tend to return different results. I use this as an example when showing people how the tooling works. Grep is fine for simple use cases. A step up from that is ast-grep and I need to explore this tool more. But I had the most s", "context": "works in large, old codebases", "use_case": "parsing legacy code for agents", "switched_from": "", "story": "One Month Without AI"}, {"id": 767323250, "item_id": 47957703, "url": "https://news.ycombinator.com/item?id=47957703", "by": "rs545837", "date": "2026-04-29", "stance": "neutral", "quote": "extracts entities from 30+ languages via tree-sitter", "excerpt": "I agree 100% with this thinking approach, I've been working in this domain for quite a few months now. The right granularity for agents isn't files or lines, it's entities: functions, classes, methods. That's how both humans and agents actually think about code. We built sem(Ataraxy-Labs/sem) which extracts entities from 30+ languages via tree-sitter and builds a cross-file dependency graph, so building semantic vers", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Vera: a programming language designed for machines to write"}, {"id": 800864145, "item_id": 50054009, "url": "https://news.ycombinator.com/item?id=50054009", "by": "ryuuseijin", "date": "2026-10-12", "stance": "neutral", "quote": "parses the repo code and docs with treesitter", "excerpt": "OK, so, I too have built a local index tool called slopdex [1]. It's very simple, parses the repo code and docs with treesitter, indexes it, vectorizes everything, then allows you do things like create a map of the codebase or do a semantic search. One cool trick that does work well is the cross-search command, which allows you to do a duplicate code search using the vector index. This gets rid of a blind spot that l", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}]}, {"text": " Complaints are scattered rather than shared: indentation-based languages are hard to support, some languages lack packaged parsers,", "cites": [{"id": 786342704, "item_id": 49146419, "url": "https://news.ycombinator.com/item?id=49146419", "by": "dunham", "date": "2026-08-02", "stance": "warn", "quote": "it's a pain to get tree-sitter to handle it", "excerpt": "I don't mind indentation based languages. I used to hate them, but they've grown on me after using python, Haskell, Idris, Agda, etc. And I ended up making my own language indentation based (it is similar to Idris). That said, it is hard-mode: - You'll have to figure out how to parse it. - If you want editor support, it's a pain to get tree-sitter to handle it. - You may not be able to pull off editor operations like", "context": "language implementer", "use_case": "editor support for indentation-based language", "switched_from": "", "story": "F*: A general-purpose proof-oriented programming language"}, {"id": 747528016, "item_id": 46720501, "url": "https://news.ycombinator.com/item?id=46720501", "by": "tetris11", "date": "2026-01-22", "stance": "recommend", "quote": "I love tree-sitter+eglot", "excerpt": "I love tree-sitter+eglot but a few of the languages/schemes I work in, simply don't have parsers: > pacman -Ssq tree-sitter tree-sitter tree-sitter-bash tree-sitter-c tree-sitter-cli tree-sitter-javascript tree-sitter-lua tree-sitter-markdown tree-sitter-python tree-sitter-query tree-sitter-rust tree-sitter-vim tree-sitter-vimdoc Where's R, YAML, Golang, and several others?", "context": "", "use_case": "editor syntax support", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}]}, {"text": " and structural editing has disappointed in most editors.", "cites": [{"id": 748387728, "item_id": 46774233, "url": "https://news.ycombinator.com/item?id=46774233", "by": "logicprog", "date": "2026-01-26", "stance": "warn", "quote": "while I used to have hope for tree-sitter to provide a similar level of structural editing for other languages, at least in most editors I've just not found that to be the case", "excerpt": "Yes! Don't worry about it, I very much agree. However, I do think that even if/when I'm using Lisp and have all the best structural editing capabilities at my disposal, I'd still prefer to have an agent do my editing for me; I'd just be 30% more likely to jump in and write code myself on occasion \u2014 because ultimately, even with structural editing, you're still thinking about how to apply this constrained set of opera", "context": "", "use_case": "structural editing", "switched_from": "", "story": "After two years of vibecoding, I'm back to writing by hand"}]}], "praise": [{"label": "Code analysis tooling", "summary": "Used to parse codebases into ASTs for indexing, querying, semantic diffs and agent tools.", "quotes": [{"id": 797703793, "item_id": 49856487, "url": "https://news.ycombinator.com/item?id=49856487", "by": "dkn", "date": "2026-09-26", "stance": "recommend", "quote": "building a small pipeline that reads the old code base, parses it file by file using tree sitter", "excerpt": "I have had a ton of success in exposing AST-based tools to agents when working in large, old codebases. Without them, not only do agents get simple things like function call counts wrong, they tend to return different results. I use this as an example when showing people how the tooling works. Grep is fine for simple use cases. A step up from that is ast-grep and I need to explore this tool more. But I had the most s", "context": "works in large, old codebases", "use_case": "parsing legacy code for agents", "switched_from": "", "story": "One Month Without AI"}, {"id": 767323250, "item_id": 47957703, "url": "https://news.ycombinator.com/item?id=47957703", "by": "rs545837", "date": "2026-04-29", "stance": "neutral", "quote": "extracts entities from 30+ languages via tree-sitter", "excerpt": "I agree 100% with this thinking approach, I've been working in this domain for quite a few months now. The right granularity for agents isn't files or lines, it's entities: functions, classes, methods. That's how both humans and agents actually think about code. We built sem(Ataraxy-Labs/sem) which extracts entities from 30+ languages via tree-sitter and builds a cross-file dependency graph, so building semantic vers", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Vera: a programming language designed for machines to write"}, {"id": 800864145, "item_id": 50054009, "url": "https://news.ycombinator.com/item?id=50054009", "by": "ryuuseijin", "date": "2026-10-12", "stance": "neutral", "quote": "parses the repo code and docs with treesitter", "excerpt": "OK, so, I too have built a local index tool called slopdex [1]. It's very simple, parses the repo code and docs with treesitter, indexes it, vectorizes everything, then allows you do things like create a map of the codebase or do a semantic search. One cool trick that does work well is the cross-search command, which allows you to do a duplicate code search using the vector index. This gets rid of a blind spot that l", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}]}, {"label": "Grammar authoring", "summary": "Building grammars and parsers is described as fun and faster than hand-rolling a parser.", "quotes": [{"id": 740408960, "item_id": 46275560, "url": "https://news.ycombinator.com/item?id=46275560", "by": "danielvaughn", "date": "2025-12-15", "stance": "recommend", "quote": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so.", "excerpt": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so. It's incredibly fun once you get into a flow state. The docs call it a zen-like experience, and that's a perfect way to describe it. It's so, so good.", "context": "", "use_case": "building grammars", "switched_from": "", "story": "Arborium: Tree-sitter code highlighting with Native and WASM targets"}, {"id": 747530320, "item_id": 46720645, "url": "https://news.ycombinator.com/item?id=46720645", "by": "FjordWarden", "date": "2026-01-22", "stance": "recommend", "quote": "the overall DevEx is much quicker that hand-rolling the parser", "excerpt": "This is like the difference between an orange and fruit juice. You can squeeze an orange to extract its juices, but that is not the only thing you can do with it, nor is it the only way to make fruit juice. I use tree-sitter for developing a custom programming language, you still need an extra step to get from CST to AST, but the overall DevEx is much quicker that hand-rolling the parser.", "context": "developing a custom programming language", "use_case": "custom language parsing", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 763480656, "item_id": 47717541, "url": "https://news.ycombinator.com/item?id=47717541", "by": "derstruct", "date": "2026-04-10", "stance": "recommend", "quote": "Actually with tree-sitter it's much less moving parts inside parser-generator core", "excerpt": "Actually with tree-sitter it's much less moving parts inside parser-generator core (5-10x LOC less then templ, but it's difficult to compare because structure differences). My theory that I don't have to care a lot about gopls changes, because I rely on LSP protocol itself when doing conversion. I basically scan exchange JSONs for locations (sometimes recursively) that are related to `.gox` or generated `.x.go` and p", "context": "author of a Go HTML template extension", "use_case": "parsing in Go template extension", "switched_from": "", "story": "Show HN: Go language extension with HTML templates"}]}, {"label": "Editor highlighting", "summary": "Commenters prefer its syntax highlighting over classic approaches, especially in Emacs and Neovim.", "quotes": [{"id": 797882881, "item_id": 49867680, "url": "https://news.ycombinator.com/item?id=49867680", "by": "WesolyKubeczek", "date": "2026-09-27", "stance": "recommend", "quote": "I think treesitter runs circles around what classic vim is using to highlight syntax.", "excerpt": "I used neovim because it felt way faster by default. I think treesitter runs circles around what classic vim is using to highlight syntax. That said, I never used both beyond basics, thus no horror stories either.", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "On caring for user data: NeoVim caused Vim undo files to be deleted"}, {"id": 747604449, "item_id": 46725278, "url": "https://news.ycombinator.com/item?id=46725278", "by": "Conscat", "date": "2026-01-22", "stance": "recommend", "quote": "I love how easy it is to write Tree Sitter queries for very special patterns", "excerpt": "I find neither LSP for Tree Sitter sufficient for syntax highlighting, but I am extremely satisfied by my special combination of _both_ in Emacs. I love how easy it is to write Tree Sitter queries for very special patterns, like highlighting namespace declarations differently from scope resolution, or highlighting inline assembly differently from normal strings. But I really want the semantic highlighting from a lang", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 784334259, "item_id": 49020891, "url": "https://news.ycombinator.com/item?id=49020891", "by": "TacticalCoder", "date": "2026-07-23", "stance": "recommend", "quote": "Emacs now with tree-sitter, LSPs, native-compilation, magit", "excerpt": "> IntelliJ (actually Android Studio based on IntelliJ) was my first real IDE and real programming experience. I was so blown away ! I switched to IntelliJ back when people where still arguing which of the two between Eclipse or NetBeans was better (fools!): that is, before some of the commenters here were born. Heck, I bought IntelliJ when the world was ending in the Mayan calendar, it was something like 75% off beca", "context": "", "use_case": "syntax parsing in Emacs", "switched_from": "", "story": "Escape IntelliJ: Scala and Kotlin LSPs on Emacs Eglot"}]}, {"label": "Easy queries", "summary": "Queries for special highlighting or formatting patterns are easy to write.", "quotes": [{"id": 747604449, "item_id": 46725278, "url": "https://news.ycombinator.com/item?id=46725278", "by": "Conscat", "date": "2026-01-22", "stance": "recommend", "quote": "I love how easy it is to write Tree Sitter queries for very special patterns", "excerpt": "I find neither LSP for Tree Sitter sufficient for syntax highlighting, but I am extremely satisfied by my special combination of _both_ in Emacs. I love how easy it is to write Tree Sitter queries for very special patterns, like highlighting namespace declarations differently from scope resolution, or highlighting inline assembly differently from normal strings. But I really want the semantic highlighting from a lang", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 764817120, "item_id": 47801070, "url": "https://news.ycombinator.com/item?id=47801070", "by": "TacticalCoder", "date": "2026-04-16", "stance": "recommend", "quote": "tree-sitter is much easier than it looks like", "excerpt": "I moved to tree-sitter inside Emacs a while ago and I'd say tree-sitter is much easier than it looks like. I had a first little use case... For whatever reason the options to align let bindings in Clojure code, no matter if I tried the \"semantic\" or Tonsky's semi-standard way of formatting Clojure code (several tools adopted Tonsky's suggestion) and no matter which option/knob I turned on, I couldn't align like I wan", "context": "Emacs user", "use_case": "custom Clojure let-binding alignment", "switched_from": "", "story": "A Better R Programming Experience Thanks to Tree-sitter"}]}, {"label": "Reusable grammars", "summary": "One grammar can serve an editor extension and an LSP written in different languages.", "quotes": [{"id": 747597504, "item_id": 46724844, "url": "https://news.ycombinator.com/item?id=46724844", "by": "geophph", "date": "2026-01-22", "stance": "recommend", "quote": "Kinda nice that the same tree-sitter grammar can be used across the extension and LSP", "excerpt": "Funny timing. I\u2019ve been building an LSP for a niche DSL I use at work. I\u2019ve been using tree-sitter to build out the AST of sorts for the LSP functions, but just yesterday it dawned on me that the syntax highlighting my LSP does is all just TS queries and encoding them properly for the protocol. So I was looking into if that can be done in the vscode extension that provides the LSP hookup instead. Kinda nice that the ", "context": "building an LSP for a niche DSL at work", "use_case": "building AST and syntax highlighting for LSP", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 734576993, "item_id": 45911062, "url": "https://news.ycombinator.com/item?id=45911062", "by": "vinnyhaps", "date": "2025-11-12", "stance": "recommend", "quote": "It\u2019s really cool to see tree-sitter unlock so many of these use cases.", "excerpt": "I\u2019m pretty sure one of the Zed founders wrote tree-sitter, so I\u2019m sure there\u2019s some overlap It\u2019s really cool to see tree-sitter unlock so many of these use cases. I love using [difftastic] for my diffing tool to get context aware diffs. So in the example from the article, the diff would highlight the `void` and `int` changes with a heavier background of red and green respectively [difftastic]: https://github.com/Wilf", "context": "", "use_case": "syntax-aware tooling", "switched_from": "", "story": "Mergiraf: Syntax-Aware Merging for Git"}]}, {"label": "Error tolerance", "summary": "Creates ERROR or MISSING nodes, making it usable as an error-tolerant compiler frontend.", "quotes": [{"id": 739507808, "item_id": 46219238, "url": "https://news.ycombinator.com/item?id=46219238", "by": "VonTum", "date": "2025-12-10", "stance": "recommend", "quote": "I just use it as an error-tolerant frontend to my compiler.", "excerpt": "Oh nono, with tree-sitter, you get an untyped syntax tree. That means, you have a Cursor object to walk the tree, which creates Node objects as you traverse, that have a \"kind\" (name of the tree-sitter node), span, and children. (I recommend using the rust tree-sitter bindings itself, not the rust wrapper rust-sitter). Yes, portability like that is a huge benefit, though I personally utilized it for that yet. I just ", "context": "compiler developer", "use_case": "error-tolerant compiler frontend", "switched_from": "", "story": "Revisiting \"Let's Build a Compiler\""}]}], "caveats": [{"label": "Indentation languages", "summary": "Getting it to handle indentation-based languages is described as a pain.", "quotes": [{"id": 786342704, "item_id": 49146419, "url": "https://news.ycombinator.com/item?id=49146419", "by": "dunham", "date": "2026-08-02", "stance": "warn", "quote": "it's a pain to get tree-sitter to handle it", "excerpt": "I don't mind indentation based languages. I used to hate them, but they've grown on me after using python, Haskell, Idris, Agda, etc. And I ended up making my own language indentation based (it is similar to Idris). That said, it is hard-mode: - You'll have to figure out how to parse it. - If you want editor support, it's a pain to get tree-sitter to handle it. - You may not be able to pull off editor operations like", "context": "language implementer", "use_case": "editor support for indentation-based language", "switched_from": "", "story": "F*: A general-purpose proof-oriented programming language"}]}, {"label": "Missing parsers", "summary": "Some languages, such as R, YAML and Go, lacked packaged parsers for one user.", "quotes": [{"id": 747528016, "item_id": 46720501, "url": "https://news.ycombinator.com/item?id=46720501", "by": "tetris11", "date": "2026-01-22", "stance": "recommend", "quote": "I love tree-sitter+eglot", "excerpt": "I love tree-sitter+eglot but a few of the languages/schemes I work in, simply don't have parsers: > pacman -Ssq tree-sitter tree-sitter tree-sitter-bash tree-sitter-c tree-sitter-cli tree-sitter-javascript tree-sitter-lua tree-sitter-markdown tree-sitter-python tree-sitter-query tree-sitter-rust tree-sitter-vim tree-sitter-vimdoc Where's R, YAML, Golang, and several others?", "context": "", "use_case": "editor syntax support", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}]}, {"label": "Structural editing", "summary": "One commenter found it has not delivered Lisp-level structural editing in most editors.", "quotes": [{"id": 748387728, "item_id": 46774233, "url": "https://news.ycombinator.com/item?id=46774233", "by": "logicprog", "date": "2026-01-26", "stance": "warn", "quote": "while I used to have hope for tree-sitter to provide a similar level of structural editing for other languages, at least in most editors I've just not found that to be the case", "excerpt": "Yes! Don't worry about it, I very much agree. However, I do think that even if/when I'm using Lisp and have all the best structural editing capabilities at my disposal, I'd still prefer to have an agent do my editing for me; I'd just be 30% more likely to jump in and write code myself on occasion \u2014 because ultimately, even with structural editing, you're still thinking about how to apply this constrained set of opera", "context": "", "use_case": "structural editing", "switched_from": "", "story": "After two years of vibecoding, I'm back to writing by hand"}]}, {"label": "Grammar limits", "summary": "Lack of alternate roots forced one project to maintain a custom C grammar.", "quotes": [{"id": 739081264, "item_id": 46192579, "url": "https://news.ycombinator.com/item?id=46192579", "by": "xvilka", "date": "2025-12-08", "stance": "recommend", "quote": "We use the tree-sitter[1] for parsing C declarations in Rizin[2]", "excerpt": "We use the tree-sitter[1] for parsing C declarations in Rizin[2] (see the \"td\" command, for example). See our custom grammar[3] (modified mainstream tree-sitter-c). The custom grammar was sadly necessary, due to the inability of Tree-Sitter to have the alternate roots[4]. P.S. Please add a license for your code. [1] https://tree-sitter.github.io/ [2] https://github.com/rizinorg/rizin/tree/dev/librz/type/parser [3] ht", "context": "", "use_case": "parsing C declarations", "switched_from": "", "story": "Show HN: Cdecl-dump - represent C declarations visually"}]}, {"label": "Markdown errors", "summary": "One user hit constant Markdown errors that disabled highlighting and formatting.", "quotes": [{"id": 781902929, "item_id": 48868933, "url": "https://news.ycombinator.com/item?id=48868933", "by": "xprnio", "date": "2026-07-10", "stance": "warn", "quote": "Whatever AI did to TreeSitter caused it to constantly yell at me about errors because of markdown", "excerpt": "I switched to Emacs. Whatever AI did to TreeSitter caused it to constantly yell at me about errors because of markdown which I do not have the energy to figure out, while losing syntax highlighting and formatting support entirely whenever that happens. Otherwise though - same as usual, although I do keep my AI agent and my editor separate since I still choose to review, verify, and even write a lot of the code myself", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "How do you use Vim in the era of AI?"}]}, {"label": "CGO dependency", "summary": "Using it from Go requires CGO, which complicates Bazel Gazelle extensions.", "quotes": [{"id": 754498272, "item_id": 47156142, "url": "https://news.ycombinator.com/item?id=47156142", "by": "sluongng", "date": "2026-02-25", "stance": "recommend", "quote": "Oh this is really neat for the Bazel community", "excerpt": "Oh this is really neat for the Bazel community, as depending on tree-sitter to build a gazelle language extension, with Gazelle written in Go, requires you to use CGO. Now perhaps we can get rid of the CGO dependency and make it pure Go instead. I have pinged some folks to take a look at it.", "context": "Bazel community", "use_case": "Gazelle language extension", "switched_from": "", "story": "Show HN: I ported Tree-sitter to Go"}]}], "who": [{"by": "dkn", "context": "works in large, old codebases", "url": "https://news.ycombinator.com/item?id=49856487", "date": "2026-09-26"}, {"by": "vinhnx", "context": "author of VT Code", "url": "https://news.ycombinator.com/item?id=48332763", "date": "2026-05-29"}, {"by": "TacticalCoder", "context": "Emacs user", "url": "https://news.ycombinator.com/item?id=47801070", "date": "2026-04-16"}, {"by": "derstruct", "context": "author of a Go HTML template extension", "url": "https://news.ycombinator.com/item?id=47717541", "date": "2026-04-10"}, {"by": "gritzko", "context": "works on a CRDT-based revision control system project", "url": "https://news.ycombinator.com/item?id=47157301", "date": "2026-02-25"}, {"by": "sluongng", "context": "Bazel community", "url": "https://news.ycombinator.com/item?id=47156142", "date": "2026-02-25"}, {"by": "geophph", "context": "building an LSP for a niche DSL at work", "url": "https://news.ycombinator.com/item?id=46724844", "date": "2026-01-22"}, {"by": "FjordWarden", "context": "developing a custom programming language", "url": "https://news.ycombinator.com/item?id=46720645", "date": "2026-01-22"}, {"by": "VonTum", "context": "compiler developer", "url": "https://news.ycombinator.com/item?id=46219238", "date": "2025-12-10"}], "tags": ["for Emacs users", "for language implementers", "for code analysis tools", "for LLM agent tooling", "for Neovim users"], "use_cases": ["syntax highlighting", "parsing code", "parsing legacy code for agents", "code parsing in text editor", "parsing code structure", "editor support for indentation-based language"], "compared": [{"slug": "emacs", "name": "Emacs", "co": 4, "switched_from": 0, "switched_to": 0}, {"slug": "ast-grep", "name": "ast-grep", "co": 3, "switched_from": 0, "switched_to": 0}, {"slug": "claude-code", "name": "Claude Code", "co": 2, "switched_from": 0, "switched_to": 0}, {"slug": "visual-studio-code", "name": "Visual Studio Code", "co": 2, "switched_from": 0, "switched_to": 0}, {"slug": "rustfmt", "name": "rustfmt", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=46719899", "title": "Tree-sitter vs. Language Servers", "mentions": 4}, {"url": "https://news.ycombinator.com/item?id=49526131", "title": "I used Fable to rewrite 65kLoC of Go in Rust. It cost $400", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=47155597", "title": "Show HN: I ported Tree-sitter to Go", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=47023651", "title": "Show HN: A universal code formatter using Rust, Tree-sitter, and Rhai", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=50049508", "title": "Local Indexing to reduce tool calling and token usage", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=49867067", "title": "On caring for user data: NeoVim caused Vim undo files to be deleted", "mentions": 1}], "sentiment_by_month": {"2025-11": {"recommend": 1}, "2025-12": {"recommend": 3}, "2026-01": {"neutral": 1, "recommend": 4, "warn": 1}, "2026-02": {"neutral": 1, "recommend": 3, "compare": 1}, "2026-03": {}, "2026-04": {"recommend": 2, "neutral": 1}, "2026-05": {"neutral": 1}, "2026-06": {"neutral": 3}, "2026-07": {"warn": 1, "recommend": 1}, "2026-08": {"warn": 1, "neutral": 1}, "2026-09": {"neutral": 2, "recommend": 2}, "2026-10": {"neutral": 1}}, "quotes": [{"id": 800864145, "item_id": 50054009, "url": "https://news.ycombinator.com/item?id=50054009", "by": "ryuuseijin", "date": "2026-10-12", "stance": "neutral", "quote": "parses the repo code and docs with treesitter", "excerpt": "OK, so, I too have built a local index tool called slopdex [1]. It's very simple, parses the repo code and docs with treesitter, indexes it, vectorizes everything, then allows you do things like create a map of the codebase or do a semantic search. One cool trick that does work well is the cross-search command, which allows you to do a duplicate code search using the vector index. This gets rid of a blind spot that l", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Local Indexing to reduce tool calling and token usage"}, {"id": 797882881, "item_id": 49867680, "url": "https://news.ycombinator.com/item?id=49867680", "by": "WesolyKubeczek", "date": "2026-09-27", "stance": "recommend", "quote": "I think treesitter runs circles around what classic vim is using to highlight syntax.", "excerpt": "I used neovim because it felt way faster by default. I think treesitter runs circles around what classic vim is using to highlight syntax. That said, I never used both beyond basics, thus no horror stories either.", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "On caring for user data: NeoVim caused Vim undo files to be deleted"}, {"id": 797703793, "item_id": 49856487, "url": "https://news.ycombinator.com/item?id=49856487", "by": "dkn", "date": "2026-09-26", "stance": "recommend", "quote": "building a small pipeline that reads the old code base, parses it file by file using tree sitter", "excerpt": "I have had a ton of success in exposing AST-based tools to agents when working in large, old codebases. Without them, not only do agents get simple things like function call counts wrong, they tend to return different results. I use this as an example when showing people how the tooling works. Grep is fine for simple use cases. A step up from that is ast-grep and I need to explore this tool more. But I had the most s", "context": "works in large, old codebases", "use_case": "parsing legacy code for agents", "switched_from": "", "story": "One Month Without AI"}, {"id": 794996625, "item_id": 49687289, "url": "https://news.ycombinator.com/item?id=49687289", "by": "eager_noob", "date": "2026-09-13", "stance": "neutral", "quote": "a tree-sitter based Vi/Vim compatible tags generator", "excerpt": "Iterating through and evaluating possible approaches for shrinking the binary size of a tree-sitter based Vi/Vim compatible tags generator I am developing without affecting the developer experience for adding support for newer languages[1]. A couple of approaches have already been tried and failed to live up to the expectations on developer experience [2][3]. Next in line is to look into bundling only the tree-walkin", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Ask HN: What are you working on? (September 2026)"}, {"id": 792552448, "item_id": 49534528, "url": "https://news.ycombinator.com/item?id=49534528", "by": "aka-rider", "date": "2026-09-02", "stance": "neutral", "quote": "tree-sitter support is better Rust so it seemed like a good fit.", "excerpt": "Thanks for the feedback. My main goal was to present the idea with an intermediate representation, I didn't payed much attention to the specifics of this translation, it would vary wildly depending on code bases. 65k LoC of Go without comments resulted in roughly 60k LoC of Rust witout comments (code column of the cloc tool). The error handling is not so different between Rust and Go, in both cases I cannot panic to ", "context": "", "use_case": "code parsing in text editor", "switched_from": "", "story": "I used Fable to rewrite 65kLoC of Go in Rust. It cost $400"}, {"id": 792448721, "item_id": 49528045, "url": "https://news.ycombinator.com/item?id=49528045", "by": "aka-rider", "date": "2026-09-01", "stance": "neutral", "quote": "I added tree-sitter, and a bunch of syntaxes highlighters.", "excerpt": "I realized that I haven't answered the question. These $400 also include the tests. Fable ported \"human fuzzing session\" (the best bug hunter) from Go to Rust and used it to validate everything else. I used hierarchical state machines, so a lot of my QA gates were encoded into the implementation \u2014 impossible states are, well, impossible. (I ported first 80% practically in one shot, planning and then leaving Fable ove", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "I used Fable to rewrite 65kLoC of Go in Rust. It cost $400"}, {"id": 787366001, "item_id": 49210375, "url": "https://news.ycombinator.com/item?id=49210375", "by": "mickeyp", "date": "2026-08-07", "stance": "neutral", "quote": "by using the output of tree-sitter", "excerpt": "This is one of the things Combobulate [0] tries to solve by using the output of tree-sitter. Simple breadcrumbs are easy enough to do (your cursor has a clear parental lineage) but much harder to do if you want to retain semantic things, or do interesting things with (say) sibling nodes. You can see the treeview it generates in the GIFs in the link below [0] https://github.com/mickeynp/combobulate", "context": "", "use_case": "parsing code structure", "switched_from": "", "story": "Ask HN: Do modern code editors need stronger visual hierarchy?"}, {"id": 786342704, "item_id": 49146419, "url": "https://news.ycombinator.com/item?id=49146419", "by": "dunham", "date": "2026-08-02", "stance": "warn", "quote": "it's a pain to get tree-sitter to handle it", "excerpt": "I don't mind indentation based languages. I used to hate them, but they've grown on me after using python, Haskell, Idris, Agda, etc. And I ended up making my own language indentation based (it is similar to Idris). That said, it is hard-mode: - You'll have to figure out how to parse it. - If you want editor support, it's a pain to get tree-sitter to handle it. - You may not be able to pull off editor operations like", "context": "language implementer", "use_case": "editor support for indentation-based language", "switched_from": "", "story": "F*: A general-purpose proof-oriented programming language"}, {"id": 784334259, "item_id": 49020891, "url": "https://news.ycombinator.com/item?id=49020891", "by": "TacticalCoder", "date": "2026-07-23", "stance": "recommend", "quote": "Emacs now with tree-sitter, LSPs, native-compilation, magit", "excerpt": "> IntelliJ (actually Android Studio based on IntelliJ) was my first real IDE and real programming experience. I was so blown away ! I switched to IntelliJ back when people where still arguing which of the two between Eclipse or NetBeans was better (fools!): that is, before some of the commenters here were born. Heck, I bought IntelliJ when the world was ending in the Mayan calendar, it was something like 75% off beca", "context": "", "use_case": "syntax parsing in Emacs", "switched_from": "", "story": "Escape IntelliJ: Scala and Kotlin LSPs on Emacs Eglot"}, {"id": 781902929, "item_id": 48868933, "url": "https://news.ycombinator.com/item?id=48868933", "by": "xprnio", "date": "2026-07-10", "stance": "warn", "quote": "Whatever AI did to TreeSitter caused it to constantly yell at me about errors because of markdown", "excerpt": "I switched to Emacs. Whatever AI did to TreeSitter caused it to constantly yell at me about errors because of markdown which I do not have the energy to figure out, while losing syntax highlighting and formatting support entirely whenever that happens. Otherwise though - same as usual, although I do keep my AI agent and my editor separate since I still choose to review, verify, and even write a lot of the code myself", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "How do you use Vim in the era of AI?"}, {"id": 776966849, "item_id": 48560428, "url": "https://news.ycombinator.com/item?id=48560428", "by": "iovrthoughtthis", "date": "2026-06-16", "stance": "neutral", "quote": "create an abstract syntax tree over the tree sitter trees for queries that work across language", "excerpt": "apologies, the names is a little tongue in cheek. the goals of this is: 1. create an abstract syntax tree over the tree sitter trees for queries that work across language (function) @f matches functions in any supported language 2. create a smaller (in text) query language based on the semantics of css selectors e.g. in the 'c' language id#Validate -> [((function_definition declarator: (function_declarator declarator", "context": "", "use_case": "code querying", "switched_from": "", "story": "Cascading Tree Sitter Queries"}, {"id": 776643010, "item_id": 48540188, "url": "https://news.ycombinator.com/item?id=48540188", "by": "brainless", "date": "2026-06-15", "stance": "neutral", "quote": "use tree-sitter to statically check code to PRD", "excerpt": "I am not a language nerd but I keep on experimenting in my own ways to use the type system to generate code that is more reliable. I build a coding agent specifically for small models, which makes everything harder. I started this chat with Claude to build the next step: https://claude.ai/share/4264e5f6-b334-426c-afe4-904d233ef946 - how can I go from PRD to a typed representation of the business logic. The I started ", "context": "", "use_case": "static code checking", "switched_from": "", "story": "Formal Methods and the Future of Programming"}, {"id": 775506497, "item_id": 48469156, "url": "https://news.ycombinator.com/item?id=48469156", "by": "nnunley", "date": "2026-06-09", "stance": "neutral", "quote": "It uses Tree-Sitter for syntax awareness", "excerpt": "I have a similar tool to shrink ray, called [bonsai](https://github.com/nnunley/bonsai). I designed it to allow me to try to inline and reduce code for both simplifying single file examples, as well working across multiple files. It uses Tree-Sitter for syntax awareness, and the [Perses algorithm](https://doi.org/10.1109/ICSE.2018.00046) as the methodology for simplification. I'd love to get some feedback if anyone's", "context": "", "use_case": "syntax-aware parsing", "switched_from": "", "story": "Test-case reducers are underappreciated debugging tools"}, {"id": 773324210, "item_id": 48332763, "url": "https://news.ycombinator.com/item?id=48332763", "by": "vinhnx", "date": "2026-05-29", "stance": "neutral", "quote": "I also tried to use tree-sitter to enhance the user's prompt parser grammar", "excerpt": "Thank you for checking out VT Code! \u201cLLM-native code understanding\u201d refers to VT Code's approach of using LLM as the primary mechanism for semantic code analysis rather than relying solely on traditional static analysis tools. I have tried using ast-grep for structured code parsing understanding as a ground truth before/after the agent executes a code analysis or does a code edit/write operation and code context unde", "context": "author of VT Code", "use_case": "parsing prompts and code", "switched_from": "", "story": "Show HN: VT Code \u2013 open-source terminal coding agent in Rust"}, {"id": 767323250, "item_id": 47957703, "url": "https://news.ycombinator.com/item?id=47957703", "by": "rs545837", "date": "2026-04-29", "stance": "neutral", "quote": "extracts entities from 30+ languages via tree-sitter", "excerpt": "I agree 100% with this thinking approach, I've been working in this domain for quite a few months now. The right granularity for agents isn't files or lines, it's entities: functions, classes, methods. That's how both humans and agents actually think about code. We built sem(Ataraxy-Labs/sem) which extracts entities from 30+ languages via tree-sitter and builds a cross-file dependency graph, so building semantic vers", "context": "", "use_case": "parsing code", "switched_from": "", "story": "Vera: a programming language designed for machines to write"}, {"id": 764817120, "item_id": 47801070, "url": "https://news.ycombinator.com/item?id=47801070", "by": "TacticalCoder", "date": "2026-04-16", "stance": "recommend", "quote": "tree-sitter is much easier than it looks like", "excerpt": "I moved to tree-sitter inside Emacs a while ago and I'd say tree-sitter is much easier than it looks like. I had a first little use case... For whatever reason the options to align let bindings in Clojure code, no matter if I tried the \"semantic\" or Tonsky's semi-standard way of formatting Clojure code (several tools adopted Tonsky's suggestion) and no matter which option/knob I turned on, I couldn't align like I wan", "context": "Emacs user", "use_case": "custom Clojure let-binding alignment", "switched_from": "", "story": "A Better R Programming Experience Thanks to Tree-sitter"}, {"id": 763480656, "item_id": 47717541, "url": "https://news.ycombinator.com/item?id=47717541", "by": "derstruct", "date": "2026-04-10", "stance": "recommend", "quote": "Actually with tree-sitter it's much less moving parts inside parser-generator core", "excerpt": "Actually with tree-sitter it's much less moving parts inside parser-generator core (5-10x LOC less then templ, but it's difficult to compare because structure differences). My theory that I don't have to care a lot about gopls changes, because I rely on LSP protocol itself when doing conversion. I basically scan exchange JSONs for locations (sometimes recursively) that are related to `.gox` or generated `.x.go` and p", "context": "author of a Go HTML template extension", "use_case": "parsing in Go template extension", "switched_from": "", "story": "Show HN: Go language extension with HTML templates"}, {"id": 754677520, "item_id": 47167345, "url": "https://news.ycombinator.com/item?id=47167345", "by": "amno", "date": "2026-02-26", "stance": "compare", "quote": "How does this project compares to something like tree-sitter?", "excerpt": "I have read through your pdf and I think you make a best case for Lisp I have read in last few years. We could just imagine who programming languages would look like if we abandoned the specialized notations like Haskell or C++, of which C++ really starts to show up that such notations are probably a dead-end. Or if B. Eich was allowed to use Scheme as the built-in scripting language for Netscape. Perhaps we would no", "context": "", "use_case": "parsing source code into ASTs", "switched_from": "", "story": "Show HN: One grammar, 18 YAML parsers \u2013 a Futamura projector in Common Lisp"}, {"id": 754516816, "item_id": 47157301, "url": "https://news.ycombinator.com/item?id=47157301", "by": "gritzko", "date": "2026-02-25", "stance": "recommend", "quote": "I used tree-sitter for coarse AST.", "excerpt": "I work on a revision control system project, except merge is CRDT. On Feb 22 there was a server break-in (I did not keep unencrypted sources on the client, server login was YubiKey only, but that is not 100% guarantee). I reported break-in to my Telegram channel that day. My design docs https://replicated.wiki/blog/partII.html I used tree-sitter for coarse AST. Some key parts were missing from the server as well, bec", "context": "works on a CRDT-based revision control system project", "use_case": "coarse AST parsing", "switched_from": "", "story": "Show HN: I ported Tree-sitter to Go"}, {"id": 754498272, "item_id": 47156142, "url": "https://news.ycombinator.com/item?id=47156142", "by": "sluongng", "date": "2026-02-25", "stance": "recommend", "quote": "Oh this is really neat for the Bazel community", "excerpt": "Oh this is really neat for the Bazel community, as depending on tree-sitter to build a gazelle language extension, with Gazelle written in Go, requires you to use CGO. Now perhaps we can get rid of the CGO dependency and make it pure Go instead. I have pinged some folks to take a look at it.", "context": "Bazel community", "use_case": "Gazelle language extension", "switched_from": "", "story": "Show HN: I ported Tree-sitter to Go"}, {"id": 752416433, "item_id": 47026027, "url": "https://news.ycombinator.com/item?id=47026027", "by": "its-a-new-world", "date": "2026-02-15", "stance": "recommend", "quote": "I absolutely love the tree-sitter library, I use it in a number of projects.", "excerpt": "It is true that the current neatify scripts to not aim to replicate rustfmt. My personal goal is cross-language standardization, where reading Java, TypeScript, or Rust all follows the same visual \"layout\". Of course, I totally understand that people often have very different ideas on formatting, depending on which tool they are generally used to. That's why I made the scripts pluggable. If someone wants to build a r", "context": "", "use_case": "syntax-aware embeddings", "switched_from": "", "story": "Show HN: A universal code formatter using Rust, Tree-sitter, and Rhai"}, {"id": 752404640, "item_id": 47025290, "url": "https://news.ycombinator.com/item?id=47025290", "by": "jeremychone", "date": "2026-02-15", "stance": "neutral", "quote": "I have been thinking about using tree-sitter for \"context extraction / optimization\" for code indexing", "excerpt": "Very interesting approach. The trick is that sometimes developers use a hybrid approach, AI + Human / IDE, and in this case, we use the language formatter (for example, rustfmt). For example: For my AI Agent / CLI, the dev can add a sub-agent (non-AI) that just runs cargo fmt, and I can definitely see the value in including this as part of the default flow. But my issue is that it won't really follow rustfmt. Am I mi", "context": "", "use_case": "code indexing", "switched_from": "", "story": "Show HN: A universal code formatter using Rust, Tree-sitter, and Rhai"}, {"id": 748387728, "item_id": 46774233, "url": "https://news.ycombinator.com/item?id=46774233", "by": "logicprog", "date": "2026-01-26", "stance": "warn", "quote": "while I used to have hope for tree-sitter to provide a similar level of structural editing for other languages, at least in most editors I've just not found that to be the case", "excerpt": "Yes! Don't worry about it, I very much agree. However, I do think that even if/when I'm using Lisp and have all the best structural editing capabilities at my disposal, I'd still prefer to have an agent do my editing for me; I'd just be 30% more likely to jump in and write code myself on occasion \u2014 because ultimately, even with structural editing, you're still thinking about how to apply this constrained set of opera", "context": "", "use_case": "structural editing", "switched_from": "", "story": "After two years of vibecoding, I'm back to writing by hand"}, {"id": 747604449, "item_id": 46725278, "url": "https://news.ycombinator.com/item?id=46725278", "by": "Conscat", "date": "2026-01-22", "stance": "recommend", "quote": "I love how easy it is to write Tree Sitter queries for very special patterns", "excerpt": "I find neither LSP for Tree Sitter sufficient for syntax highlighting, but I am extremely satisfied by my special combination of _both_ in Emacs. I love how easy it is to write Tree Sitter queries for very special patterns, like highlighting namespace declarations differently from scope resolution, or highlighting inline assembly differently from normal strings. But I really want the semantic highlighting from a lang", "context": "", "use_case": "syntax highlighting", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 747597504, "item_id": 46724844, "url": "https://news.ycombinator.com/item?id=46724844", "by": "geophph", "date": "2026-01-22", "stance": "recommend", "quote": "Kinda nice that the same tree-sitter grammar can be used across the extension and LSP", "excerpt": "Funny timing. I\u2019ve been building an LSP for a niche DSL I use at work. I\u2019ve been using tree-sitter to build out the AST of sorts for the LSP functions, but just yesterday it dawned on me that the syntax highlighting my LSP does is all just TS queries and encoding them properly for the protocol. So I was looking into if that can be done in the vscode extension that provides the LSP hookup instead. Kinda nice that the ", "context": "building an LSP for a niche DSL at work", "use_case": "building AST and syntax highlighting for LSP", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 747530320, "item_id": 46720645, "url": "https://news.ycombinator.com/item?id=46720645", "by": "FjordWarden", "date": "2026-01-22", "stance": "recommend", "quote": "the overall DevEx is much quicker that hand-rolling the parser", "excerpt": "This is like the difference between an orange and fruit juice. You can squeeze an orange to extract its juices, but that is not the only thing you can do with it, nor is it the only way to make fruit juice. I use tree-sitter for developing a custom programming language, you still need an extra step to get from CST to AST, but the overall DevEx is much quicker that hand-rolling the parser.", "context": "developing a custom programming language", "use_case": "custom language parsing", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 747528016, "item_id": 46720501, "url": "https://news.ycombinator.com/item?id=46720501", "by": "tetris11", "date": "2026-01-22", "stance": "recommend", "quote": "I love tree-sitter+eglot", "excerpt": "I love tree-sitter+eglot but a few of the languages/schemes I work in, simply don't have parsers: > pacman -Ssq tree-sitter tree-sitter tree-sitter-bash tree-sitter-c tree-sitter-cli tree-sitter-javascript tree-sitter-lua tree-sitter-markdown tree-sitter-python tree-sitter-query tree-sitter-rust tree-sitter-vim tree-sitter-vimdoc Where's R, YAML, Golang, and several others?", "context": "", "use_case": "editor syntax support", "switched_from": "", "story": "Tree-sitter vs. Language Servers"}, {"id": 745275489, "item_id": 46579718, "url": "https://news.ycombinator.com/item?id=46579718", "by": "emporas", "date": "2026-01-11", "stance": "neutral", "quote": "eventually, if it works as it is supposed to, I plan to move to tree-sitter queries", "excerpt": "I am writing a Context Retrieval and Context Minimization program for Rust code. I am trying to automate my own workflow in how I use LLMs. The program is gonna do, what I am currently doing by hand, opening files and copying function/method signatures usually, from files all over the place. The key here is to fetch into the context window only what is needed for one-question/one-answer and no more, hence the Context", "context": "", "use_case": "code parsing", "switched_from": "", "story": "Ask HN: What Are You Working On? (January 2026)"}, {"id": 740408960, "item_id": 46275560, "url": "https://news.ycombinator.com/item?id=46275560", "by": "danielvaughn", "date": "2025-12-15", "stance": "recommend", "quote": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so.", "excerpt": "If you haven't tried building a grammar with tree-sitter, I highly recommend you do so. It's incredibly fun once you get into a flow state. The docs call it a zen-like experience, and that's a perfect way to describe it. It's so, so good.", "context": "", "use_case": "building grammars", "switched_from": "", "story": "Arborium: Tree-sitter code highlighting with Native and WASM targets"}, {"id": 739507808, "item_id": 46219238, "url": "https://news.ycombinator.com/item?id=46219238", "by": "VonTum", "date": "2025-12-10", "stance": "recommend", "quote": "I just use it as an error-tolerant frontend to my compiler.", "excerpt": "Oh nono, with tree-sitter, you get an untyped syntax tree. That means, you have a Cursor object to walk the tree, which creates Node objects as you traverse, that have a \"kind\" (name of the tree-sitter node), span, and children. (I recommend using the rust tree-sitter bindings itself, not the rust wrapper rust-sitter). Yes, portability like that is a huge benefit, though I personally utilized it for that yet. I just ", "context": "compiler developer", "use_case": "error-tolerant compiler frontend", "switched_from": "", "story": "Revisiting \"Let's Build a Compiler\""}, {"id": 739081264, "item_id": 46192579, "url": "https://news.ycombinator.com/item?id=46192579", "by": "xvilka", "date": "2025-12-08", "stance": "recommend", "quote": "We use the tree-sitter[1] for parsing C declarations in Rizin[2]", "excerpt": "We use the tree-sitter[1] for parsing C declarations in Rizin[2] (see the \"td\" command, for example). See our custom grammar[3] (modified mainstream tree-sitter-c). The custom grammar was sadly necessary, due to the inability of Tree-Sitter to have the alternate roots[4]. P.S. Please add a license for your code. [1] https://tree-sitter.github.io/ [2] https://github.com/rizinorg/rizin/tree/dev/librz/type/parser [3] ht", "context": "", "use_case": "parsing C declarations", "switched_from": "", "story": "Show HN: Cdecl-dump - represent C declarations visually"}, {"id": 734576993, "item_id": 45911062, "url": "https://news.ycombinator.com/item?id=45911062", "by": "vinnyhaps", "date": "2025-11-12", "stance": "recommend", "quote": "It\u2019s really cool to see tree-sitter unlock so many of these use cases.", "excerpt": "I\u2019m pretty sure one of the Zed founders wrote tree-sitter, so I\u2019m sure there\u2019s some overlap It\u2019s really cool to see tree-sitter unlock so many of these use cases. I love using [difftastic] for my diffing tool to get context aware diffs. So in the example from the article, the diff would highlight the `void` and `int` changes with a heavier background of red and green respectively [difftastic]: https://github.com/Wilf", "context": "", "use_case": "syntax-aware tooling", "switched_from": "", "story": "Mergiraf: Syntax-Aware Merging for Git"}]}