Python, Rust, Chumsky, Tree-sitter, and EdgeDB walk into a bar
EdgeDB is a developer-friendly database designed for ease of use and intuitive experience. The company has been working on developing a Language Server Protocol (LSP) to enhance the developer experience by providing features such as code completion, error highlighting, and automatic code formatting. However, they faced challenges with their existing Python parser, which lacked error recovery capabilities. To address this issue, EdgeDB explored four different options for improving their parser: Chumsky, Tree-sitter, extending their current parser, and rewriting the parser in Rust. They eventually chose to extend their current parser and rewrite it in Rust. The new Rust parser now produces a concrete syntax tree (CST) that is passed to Python, where it is mapped to an abstract syntax tree (AST). The benefits of this rewrite include unlocking error recovery during the parsing process and a 26% faster overall EdgeQL query compilation time. The completion of their LSP will further enhance the developer experience by providing features like formatting and linting, making EdgeDB an even more attractive option for developers.
Company
EdgeDB
Date published
Oct. 24, 2023
Author(s)
Aljaž M. Eržen
Word count
2406
Language
English
Hacker News points
8