Wiki: Harmony Unleashed: Combining Git Trees and Syntax Trees for Fun and Profit
For agents: Markdown version · Wiki index · Explore
- Speaker: May Walter
- Event: Reversim Summit 2024
- Video: https://www.youtube.com/watch?v=Aq0GgPUUH90
- Transcript: /transcripts/2024/07-Aq0GgPUUH90.md
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: Developer Experience, Software Engineering, Debugging, Productivity
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
The speaker explores the limitations of Version Control Systems in understanding code at the function level rather than merely as plain text and files. By combining Git commit history with Abstract Syntax Trees using an incremental parsing library, developers can gain deeper insights into code evolution and dependencies. The talk demonstrates how this combination allows for advanced queries about function changes, impact analysis, and better contextual awareness for development tools and AI. Attendees learn how bridging syntax trees and file history can solve common collaboration and maintenance challenges.
Key points
- 2:01 The speaker introduces the core question of what defines a function and outlines the discussion around Git, abstract syntax trees, and functions.
- 6:45 Git tracks changes in terms of lines and files rather than semantic code constructs like functions, making it difficult to analyze true code evolution.
- 10:53 Abstract Syntax Trees parsing allows development tools to interpret code structure beyond plain text, enabling features like syntax highlighting.
- 16:18 Incremental parsing algorithms allow efficient updating of ASTs in real time as the developer types without parsing the entire file from scratch.
- 17:19 Tree-sitter is introduced as a fast, language-agnostic, open-source library that generates ASTs and supports query mechanisms.
- 26:11 Combining Git history with Tree-sitter ASTs enables querying the database of code changes at the function level rather than just file level.
- 31:10 This combined approach opens up possibilities for smarter AI coding assistants, precise function ownership, and targeted notifications when critical code is modified.
Takeaways
- Understand that traditional version control systems operate on plain text and files, lacking semantic awareness of functions and code constructs.
- Leverage abstract syntax trees and incremental parsing libraries to analyze code structure and changes programmatically.
- Combine version history with syntax analysis to track function-level evolution, dependencies, and ownership accurately.
Questions this talk answers
- How can I track the exact change history of a specific function rather than an entire file?
- How does incremental parsing work to maintain performance in modern code editors?
- How can I combine version control data with syntax trees for advanced code analysis?
Technologies
Git, JavaScript, Rust, Python, SQL, Tree-sitter, VS Code
Tags
ast, code analysis, developer tools, git, parser, refactoring, version control