Company
Date Published
Author
Joshua Haas
Word count
1753
Language
English
Hacker News points
None

Summary

This is a blog post from Bubble's engineering team discussing their approach to storing and transmitting Abstract Syntax Trees (ASTs), which represent the structure of code in a computer. Unlike traditional programming languages, Bubble doesn't store code but instead stores ASTs as JSON documents. The team faced challenges when trying to load and manipulate these large data structures efficiently, so they invented an abstraction layer called JSONBase, which abstracts away the position in a JSON document from the actual JSON object itself. This allows for faster loading of only needed parts of the application tree into memory without worrying about errors or null references. The team developed three implementations of JSONBase: RuntimeJSON for browser rendering, EditorJSON for the Bubble editor, and ServerJSON for server-side execution. These abstractions enable efficient management of multi-megabyte documents and simplify code development by abstracting away complex issues.