BABLR Released: A Next-Generation Parser Framework Challenging Tree-sitter
After five years of development, the general-purpose JavaScript parser framework "BABLR" has been released, drawing attention as a new technology stack poised to rival Tree-sitter and ESTree.
Frontend engineer Conrad has released the latest version of the general-purpose parser framework “BABLR” after five years of development. Alongside it, a new data language for parse trees called “CSTML” and a parse tree format named “agAST” were also announced. These three technologies are positioned as components of an integrated platform.
Rethinking the Norms of IDEs At the core of
BABLR lies an ambitious vision: to rethink the very concept of Integrated Development Environments (IDEs). Traditionally, IDEs have been built around the concept of a “text file editor,” but Conrad starts from the question, “What if we built an IDE around a ‘code document editor’ instead?” In reality, document-driven coding tools are already deeply integrated into developers’ daily workflows, such as formatters for aligning indentation, linters that detect common errors, transpilers that convert new language syntax, and codemods that perform refactoring across tens to hundreds of thousands of files. BABLR aims to extend this trend by providing the foundational technology to access code structures at a more fundamental level.
The Three Pillars of Technology The release
includes the following three core technologies: BABLR — A parser framework positioned as a competitor to Tree-sitter, functioning as a general-purpose parser running on JavaScript. Notably lightweight, it is natively compatible with browsers and adds only approximately 10KB in size, enabling a level of flexibility that allows for code analysis even on documentation sites and blog posts. agAST — A parse tree format that proposes a new tree structure competing with the widely used ESTree format in the JavaScript ecosystem. CSTML — A new data language specifically designed for parse trees. The BABLR parser generates parse trees in CSTML and agAST formats, with data structures and algorithm libraries enabling practical use of these trees. While each of these technologies can be used independently, they are designed to complement one another, functioning as a platform greater than the sum of its parts when combined.
A New Experience in Code Understanding with
“Bedazzlr” To demonstrate the utility of BABLR, an interactive syntax highlighting tool called “Bedazzlr,” embedded on the same platform page, has been unveiled. Bedazzlr aims to provide an experience that goes beyond the basic token coloring offered by other tools. Its functionality resembles that of ASTExplorer, embedded directly into a web page. Users can investigate code structures through semantic selection and view the names of nodes embedded in the syntax tree. These node names can be significantly more helpful than simple color coding when learning a new programming language. Furthermore, the tool’s ability to compute this information on the frontend means that the structural representation of syntax trees is not limited to English speakers. This language-agnostic approach to understanding code structures could be a major advantage for the global developer community.
Value Proposition for Three Core Stakeholders
Conrad asserts that the long-term growth of the BABLR platform depends on how well it can find a balance that benefits its three main stakeholders: language creators, tool developers, and users. The vision is for each group to find a space on the platform where they can connect with the other two groups, creating value for everyone involved. For language creators, the platform provides a foundation for easily building and sharing parsers for their languages. For tool developers, it offers a standardized tree format for efficiently developing multilingual tools. For users, it promises richer experiences in understanding and editing code. These benefits lie at the core of BABLR’s value proposition.
Challenging the Tree-sitter Ecosystem BABLR
directly positions itself as a competitor to Tree-sitter, the incremental parsing library initially developed for GitHub’s Atom editor and now adopted by many editors and tools like Neovim and Helix. While Tree-sitter is implemented in C and has proven its ability to generate parsers for multiple languages, BABLR distinguishes itself by being JavaScript-native and prioritizing usability in browser environments. In terms of parse tree formats, ESTree has long served as the de facto standard for JavaScript Abstract Syntax Trees (ASTs). Whether agAST can emerge as a viable alternative depends on adoption by the ecosystem.
Future Prospects BABLR is still a developing
project, and Conrad candidly admits, “Whether it achieves impressive long-term growth depends on balancing the interests of the three key stakeholders.” The vision for the code editor is a visual, tactile, programmable editor that operates on web pages, and Bedazzlr is seen as the first step toward realizing that vision. After five years of development, the release of this platform marks the beginning of its challenge to the ecosystems established by Tree-sitter and ESTree. The response and adoption by the developer community will be crucial in determining its future trajectory.
Frequently Asked Questions
- What are the main differences between BABLR and Tree-sitter?
- BABLR is JavaScript-native, designed for use in browser environments, and is characterized by its lightweight design. Tree-sitter, on the other hand, is implemented in C and excels at incremental parsing for native editors. BABLR is particularly suited for use cases like in-browser code analysis and interactive syntax highlighting.
- What is CSTML?
- CSTML is a new data language for parse trees proposed by the BABLR project. It is designed as the data format for syntax trees generated by the BABLR parser and is intended to work in conjunction with the agAST tree format, providing a richer foundation for representing code structure information.
- What kind of tool is Bedazzlr?
- Bedazzlr is a syntax highlighting tool running on the BABLR platform. It goes beyond traditional token coloring to offer interactive features such as displaying node names embedded in syntax trees and investigating code structures through semantic selection. Its lightweight design, at just around 10KB, makes it easy to embed directly into web pages.
Comments