Q2 2023
RxHTML, Design Docs, and JSON Calculus
I came back from an RV trip across the southwest ready to play a different game. The Grand Canyon is certainly grand, but the real revelation was personal: I'd been coding in a vacuum, and it was time to focus on people.
The quarter opened with me rethinking organizational philosophy through Daniel Pink's lens of autonomy, mastery, and purpose. Most companies are lucky to achieve two of those. As a fiercely independent person who hated the confines of big tech, I value autonomy above all -- which makes running a business an odd choice, since business owners become slaves to their businesses. The resolution I landed on was simple: one iron rule. You must either use or extend Adama. Beyond that, do whatever you want. Base compensation, binary reviews (you met the minimum or you didn't), and the internal economy runs on dollars rather than abstract units.
From there, the hiring philosophy evolved into something resembling a law firm. Associates at various levels, partners with equity stakes, and a career ladder designed so that a high school student without credentials could build a track record. The core insight was that the gap between minimum compensation and the next promotion level creates an innovation zone -- people can invest in meta problems without asking permission. If the innovation works, it drives results. Results come with benefits.
With the organizational thinking sketched out, I wrote a post about design documents that was really a cache for my emerging intern program. The philosophy: the design document is an arena to battle with ideas, and the most important question to address without explicitly addressing it is "Why you?" Signal attention, define objectives, map the battlefield, identify unknowns. Have meetings before the meeting. Ruthless honesty.
Then I documented how RxHTML actually works, bottom up. The journey starts with a <forest> containing <page> elements. The compiler turns your HTML into JavaScript that builds the DOM reactively. A <lookup> element binds a text node to a value in a reactive tree. When the tree updates, the text node updates -- no virtual DOM diffing, no reconciliation, just a closure between the data source and the DOM node. The historical origin of RxHTML was the repetitiveness of binding data changes to DOM changes in both vanilla JS and React.
The <connection> element establishes a WebSocket connection to an Adama document. rx:iterate walks arrays reactively -- when items appear, disappear, or reorder, the DOM follows. rx:action on forms sends messages through channels. rx:if conditionally mounts elements based on view state. The view state is client-side reactive state that flows through the URI, through connections, and back to the server. Sixteen commands, three attribute template concepts, six new elements, and a bit of glue. That's RxHTML.
To prove it worked for real products, I built a Reddit clone using ChatGPT to generate the HTML and Tailwind CSS, then wired it to Adama with RxHTML. The AI generated the layouts. I extracted them into templates, added rx:iterate for posts, rx:action for forms, connected to a backend with records, tables, channels, and bubbles. The whole thing was live in maybe an hour. A community member also built a chess game in Adama, complete with move validation and real-time state sync via the canvas API.
The Reddit clone experiment surfaced something important about LLMs and declarative HTML. ChatGPT could generate reasonable templates because RxHTML is just HTML with a few extra attributes. If we fix HTML instead of building yet another JavaScript framework, we have a medium that language models can actually work with. My prediction: LLMs are a sea change for building products, and there may be more fruitful intermediate languages for developers to invest in rather than teaching machines to produce arbitrary code.
Mid-quarter, I reflected on my time at Facebook and the law of unintended consequences. Connecting everyone means connecting the good, the clueless, and the evil all in one big town center. As I pivoted toward an actual business model, I had to contend with how my technology might enable bad faith actors. The only option is faith that the good vastly outstrips the harm.
The technical highlight of June was working through JSON calculus for collaborative editing. The killer problem: arrays of objects in a differentiable, CRDT-friendly format. I explored linked-list ordering (too expensive), then landed on using floating-point numbers as sort keys with a level of indirection separating data from ordering. The scheme exploits floating-point bisection for insertions, supports concurrent edits with minimal conflict, and the server can periodically rebase the ordering. This unblocked a property editor I'd been stuck on.
By the end of Q2, I was approaching the "rails moment" -- design the backend, and then poof, a product pops out. RxHTML felt real. The organizational vision was taking shape. I had an intern shipping code. The Reddit clone demonstrated the full stack in action. And I was writing this blog post as I was solving the JSON problem, because I don't revise my writing that often.