I've implemented tree-sitter in pi before, and while it works, I have no real proof it saves me tokens, or is more accurate. I think a better implementation is a model that's trained for AST's, not just "use tool, see what happens".
I'd love to do research on this when I have the time.
Cool project!
That's what I was insinuating through "better encoder"; the model creating more efficient representations of ASTs using something like JEPA