frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I ported Tree-sitter to Go

https://github.com/odvcencio/gotreesitter
121•odvcencio•2h ago
This started as a hard requirement for my TUI-based editor application, it ended up going in a few different directions.

A suite of tools that help with semantic code entities: https://github.com/odvcencio/gts-suite

A next-gen version control system called Got: https://github.com/odvcencio/got

I think this has some pretty big potential! I think there's many classes of application (particularly legacy architecture) that can benefit from these kinds of analysis tooling. My next post will be about composing all these together, an exciting project I call GotHub. Thanks!

Comments

sluongng•1h ago
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.

odvcencio•1h ago
thanks so much for the note! i really appreciate it. i built this precisely for folks like yourself with this specific pain, thanks again!
3rly•1h ago
Wouldn't `got` be confused with OpenBSD's Got: https://gameoftrees.org/index.html
odvcencio•1h ago
oh wow! i really thought i was being too clever but i shouldve assumed nothing new under the sun. well im taking name suggestions now!
boobsbr•1h ago
Goty McGotface
sbankowi•1h ago
YAGOT (Yet Another GOT)
bityard•51m ago
Probably taken already, better use YAGOT-NG (Next Generation) just to be safe.
himata4113•42m ago
might be taken too so just YAGOT2 would work
Imustaskforhelp•54m ago
uGOT / uGOTme? (sort of like the idea behind uTorrent) but I will agree that sbankowi's idea of Yet another got is great as well. +1 to that as well.
allknowingfrog•53m ago
Well, find and sed have modern "fd" and "sd" alternatives. Naming it "gt" allows you to claim that your version save 33% compared to typing "git".
gritzko•1h ago
That is very very interesting. I work on a similar project https://replicated.wiki/blog/partII.html

I use CRDT merge though, cause 3-way metadata-less merges only provide very incremental improvements over e.g. git+mergiraf.

How do you see got's main improvement over git?

odvcencio•54m ago
primarily, got is structural VCS intended for concurrent edits of the same file.

it does this via gotreesitter and gts-suite abstractions that enable it to: - have entity-aware diffs - not line by line but function by function - structural blame - attribution resolution for the lifetime of the entity - semver from structure - it can recommend bumps because it knows what is breaking change vs minor vs patch - entity history - because entities are tracked independently, file renames or moves dont affect the entity's history

when gotreesitter cant parse a language, the 3way text merge happens as a fallback. what the structural merge enables is no conflicts unless same entity has conflicting changes

odvcencio•51m ago
gah,. sincere apologies for formatting of this post. i ahve been on HN for basically 10 years now without ever having made a post (:
dorianmariecom•46m ago
use four spaces " " in front of a line for <pre> formatting

    like "    this"
srcreigh•43m ago
It's 2 or more spaces, not four
gritzko•50m ago
I think I understand the situation.
skybrian•1h ago
How about making 'got' compatible with git repos like jujutsu? It would be a lot easier to try out.
odvcencio•52m ago
it is interoperable with git. we like git when its good but attempted to ease the pains in UX somewhat. you can take advantage of got locally but still push it to git remote forges jsut the same. when you pull stuff in this way, got will load the entity history into the git repo ensuring that you can still do got stuff locally (inspect entity histories, etc)
irishcoffee•51m ago
Is it a go-ism that source for implementation and test code lives in the root of the repo or is this an LLM thing?
odvcencio•47m ago
yeah the tests live with the implementation code always (Go thing) and the repo root thing is like a preference, main is an acceptable package to put stuff in (Go thing), i see this a lot with smaller projects or library type projects
jbreckmckye•46m ago
Interesting. I have a similar usecase but intended to use CGo tree-sitter with Zig

Are these pretty up-to-date grammars? I'm awfully tempted to switch to your project

How large are your binaries getting? I was concerned about the size of some of the grammars

odvcencio•39m ago
206 binary blobs = 15MB, so not crazy but i built for this use case where you can declare the registry of languages you want to load and not have to own all the grammar binaries by default
jbreckmckye•37m ago
If all the languages together add up to 15MB that is a game changer for me.

It means the CLI I am working on can ship support for many languages whilst still being a smallish (sub 50mb) download

I shall definitely check it out!

odvcencio•35m ago
re: up to date grammars, yes i found the official grammars in use by the original tree-sitter library today
conartist6•42m ago
It looks like porting the custom C lexers is a big part of the trouble you had to go to do this.
odvcencio•36m ago
yes basically about 70% of the engineering effort was spent porting the external scanners and ensuring parity with original (C) tree-sitter
acedTrex•28m ago
Claude attempted a treesitter to go port

Better title

odvcencio•25m ago
well how did it do?
wocram•22m ago
Shouldn't you be able to answer that?
odvcencio•21m ago
yes and if you clicked the links you would know that i did answer it in the readme.
do_not_redeem•14m ago
> Pure-Go tree-sitter runtime — no CGo, no C toolchain, WASM-ready.

No you didn't. The readme is obvious LLM slop. Em-dash, rule of three, "not x, y". Why should anyone spend effort reading something you couldn't be bothered to write? Why did you post it to HN from a burner account?

mathfailure•9m ago
But how do we know the readme isn't also vibecoded?
red_hare•23m ago
How is OP using Claude relevant?
DeepYogurt•23m ago
maintenance burden
gritzko•15m ago
OK for prototyping. Not OK for prod use if noone actually read it line by line.
odvcencio•12m ago
ii am trying to not take issue with this comment because im aware of the huge stigma around ai generated code.

i needed this project so i made it for my use case and had to build on top of it. the only way to ensure quality is to read it all line by line.

if you give me code that you yourself have not reviewed i will not review it for you.

IshKebab•10m ago
AI often produces nonsense that a human wouldn't. If a project was written using AI the chances that it is a useless mess are significantly higher than if it was written by a human.
gritzko•23m ago
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, because I expected problems (had lots of adventures in East Asia, evil maids, various other incidents on a regular basis).

When I saw "tree-sitter in go" title, I was very glad initially. Solves some problems for me. Then I saw the full picture.

shayief•22m ago
This is great, I was looking for something like this, thanks for making this!

I imagine this can very useful for Go-based forges that need syntax highlighting (i.e. Gitea, Forgejo).

I have a strict no-cgo requirement, so I might use it in my project, which is Git+JJ forge https://gitncoffee.com.

odvcencio•19m ago
thank you for the kind words! Very cool project! Very happy you can find some utility in it
trickypr•19m ago
Do you have an equivalent of TreeCursors or tree-sitter-generate?

There are at least some use cases where neither queries nor walks are suitable. And I have run into cases where being able to regenerate and compile grammars on the fly is immeasurably helpful.

At least for my use cases, this would be unusable.

Also, what the hell is this:

> partial [..] missing external scanner

Why do you have a parsing mode that guarantees incorrect outputs on some grammars (html comes to mind) and then use it as your “90x faster” benchmark figure?

odvcencio•14m ago
the 90x figure is on Go source for apples to apples against CGO bound tree-sitter.

your use case is not one i designed for although yeah maybe the readme has some sections too close. the only external scanner missing atm is norg. now that i know your use case i can probably think of a way to close it

Jimi Hendrix was a systems engineer

https://spectrum.ieee.org/jimi-hendrix-systems-engineer
35•tintinnabula•29m ago•4 comments

Bus stop balancing is fast, cheap, and effective

https://worksinprogress.co/issue/the-united-states-needs-fewer-bus-stops/
222•surprisetalk•4h ago•350 comments

om

https://www.om-language.com/
138•tosh•2h ago•29 comments

Show HN: I ported Tree-sitter to Go

https://github.com/odvcencio/gotreesitter
121•odvcencio•2h ago•42 comments

Large-Scale Online Deanonymization with LLMs

https://simonlermen.substack.com/p/large-scale-online-deanonymization
107•DalasNoin•1d ago•120 comments

Windows 11 Notepad to support Markdown

https://blogs.windows.com/windows-insider/2026/01/21/notepad-and-paint-updates-begin-rolling-out-...
59•andreynering•3h ago•123 comments

Following 35% growth, solar has passed hydro on US grid

https://arstechnica.com/science/2026/02/final-2025-data-is-in-us-energy-use-is-up-as-solar-passes...
255•rbanffy•4h ago•164 comments

AIs can't stop recommending nuclear strikes in war game simulations

https://www.newscientist.com/article/2516885-ais-cant-stop-recommending-nuclear-strikes-in-war-ga...
131•ceejayoz•7h ago•150 comments

The Misuses of the University

https://www.publicbooks.org/the-misuses-of-the-university/
84•ubasu•4h ago•60 comments

How to fold the Blade Runner origami unicorn (1996)

https://web.archive.org/web/20011104015933/www.linkclub.or.jp/~null/index_br.html
216•exvi•2d ago•30 comments

Never buy a .online domain

https://www.0xsid.com/blog/online-tld-is-pain
584•ssiddharth•7h ago•337 comments

GNU Texmacs

https://www.texmacs.org/tmweb/home/welcome.en.html
72•remywang•5h ago•28 comments

Trellis AI (YC W24) is hiring deployment lead to accelerate medication access

https://www.ycombinator.com/companies/trellis-ai/jobs/7ZlvQkN-lead-deployment-strategist
1•macklinkachorn•3h ago

New accounts on HN more likely to use em-dashes

https://www.marginalia.nu/weird-ai-crap/hn/
465•todsacerdoti•6h ago•383 comments

Claude Code Remote Control

https://code.claude.com/docs/en/remote-control
421•empressplay•13h ago•238 comments

Show HN: Django-xbench – slow endpoint aggregation for Django

https://github.com/yeongbin05/django-xbench
6•yeongbin05•3d ago•2 comments

Text-Based Google Directions

https://gdir.telae.net/
33•TigerUniversity•4d ago•11 comments

Racket v9.1

https://blog.racket-lang.org/2026/02/racket-v9-1.html
101•azhenley•3h ago•12 comments

Scipy.stats. Chatterjeexi

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.chatterjeexi.html
16•kamaraju•3d ago•2 comments

Show HN: Django Control Room – All Your Tools Inside the Django Admin

https://github.com/yassi/dj-control-room
86•yassi_dev•6h ago•44 comments

Devirtualization and Static Polymorphism

https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/
8•dalvrosa•2h ago•0 comments

US orders diplomats to fight data sovereignty initiatives

https://www.reuters.com/sustainability/boards-policy-regulation/us-orders-diplomats-fight-data-so...
333•colinhb•5h ago•282 comments

Danish government agency to ditch Microsoft software (2025)

https://therecord.media/denmark-digital-agency-microsoft-digital-independence
654•robtherobber•10h ago•330 comments

PL/0

https://en.wikipedia.org/wiki/PL/0
45•tosh•3d ago•13 comments

Topological Naming Problem

https://wiki.freecad.org/Topological_naming_problem
49•tripdout•4d ago•19 comments

100M-Row Challenge with PHP

https://github.com/tempestphp/100-million-row-challenge
158•brentroose•10h ago•80 comments

Launch HN: TeamOut (YC W22) – AI agent for planning company retreats

https://app.teamout.com/ai
28•vincentalbouy•6h ago•36 comments

LLM=True

https://blog.codemine.be/posts/2026/20260222-be-quiet/
196•avh3•11h ago•134 comments

Show HN: A real-time strategy game that AI agents can play

https://llmskirmish.com/
179•__cayenne__•10h ago•65 comments

Show HN: Linex – A daily challenge: placing pieces on a board that fights back

https://www.playlinex.com/
5•Humanista75•21h ago•1 comments