© 2020 Strange Loop
Developer tools that support multiple programming languages generally have very limited, regex-based code-analysis capabilities. Tree-sitter is a new parsing system that aims to change this paradigm. It provides a uniform C API for parsing an ever-growing set of languages. It features high-performance incremental parsing and robust error recovery, which allow it to be used to parse code in real-time in a text editor. There are bindings for using Tree-sitter from Node.js, Haskell, Ruby and Rust.
We're in the process of integrating Tree-sitter into both GitHub.com and the Atom text editor, which will allow us to analyze code accurately and efficiently, paving the way for better syntax highlighting, code navigation, and refactoring. We'll demo some new features that Tree-sitter has enabled in GitHub.com and Atom, discuss some the interesting algorithms that it uses, and share thoughts on some potential future applications.
Max Brunsfeld is an engineer on GitHub's Atom team. Prior to joining GitHub, he worked at Pivotal Labs as a full-stack engineer. He enjoys programming (especially in C, C++, and Rust), jazz guitar, bicycling, and hiking. He lives in Portland, OR with his wife and two toddlers.