Source-last Programming

Tom Larkworthy

Presented at the 12th Workshop on Live Programming (LIVE 2026). https://doi.org/10.5281/zenodo.24409111

Perhaps to build systems that are malleable and end-user programmable we need to rethink the relationship between runtime and development artifacts. It is our opinion that treating source code as the primary development artifact was the original sin that placed a one-way door between developer and user: when a saved format is authoritative, the tools that read and write that format are privileged, and everyone on the far side of the door is a user.

Lopecode is source-last: there is no external source code; the canonical representation is the live executing system. When source code is needed, functions are decompiled on demand starting from Function.prototype.toString(). Serialization becomes a projection to one of many formats: a standalone HTML file, a JavaScript IIFE or an ATProto PDS. Format-independence is a consequence of runtime-primacy. Because no format is canonical, editors, exporters and carriers are unprivileged userspace modules — a plurality of non-source editing surfaces that can be added after the program has started, without coordinating with each other.

We share three field episodes where the consequences of Lopecode's format agnosticism shone: shipping a tool into a locked-down corporate environment; liberating a running program from a notebook SaaS; and tunnelling an AI investigator into a third-party website.

https://tomlarkworthy.github.io/lopebooks/notebooks/@tomlarkworthy_lopecode-live-2026.html

The headline

Source-last design. When the live runtime is canonical and every cell carries recoverable source, serialization becomes a pluggable reflective projection. Distribution (§Field Episode I: Ship the system to the data), cheap copies (§Serializing the live system), format plurality (§Serialization Formats are mappings from the runtime), liberation (§Field Episode II: Retrieving a program without source access) and carrying a running program, its editors and an agent into a foreign origin (§Field Episode III: Moving a program into a foreign application) are separate features, written at different times. They share a base (§Lopecode core) and because no format is canonical, a new one can be added without coordination. Our argument is that source-last programming has contributed substantially to Lopecode's maintainability as a live and malleable programming system. It makes sense that a live system's canonical representation should be the running live system, so how does static source code fit with that? Lopecode's experience is we can get rid of it as a separate artifact, and we experienced a number of unanticipated advantages of doing so.

Building on the past

Lopecode shares similarities with image persistence in Smalltalk and Lisp, ColorForth's self-rewriting source and Interlisp's residential environments; it evolved from Observable hosted reactive notebooks; it has document-first self-modifying-file features similar to Miranda , Webstrates and Codestrates; and it is a self-sustainable system in the sense of BootstrapLab. §Related work has more details. In this work we focus on pragmatic real-world problems Lopecode solves, and focus on one of the unique architectural design (decompilation) which has kept Lopecode evolvable.

Keeping a critical eye

Source-last is driven by decompilation which has edge cases in general. You need to design for reversibility, which can constrain and impede adding languages. An AI agent targeting the low level representation can write definitions that do not decompile. Closures are not observable in JavaScript's toString, so the recoverability of source is partly a property of the Observable Runtime's cell shape. Lots of Lopecode's features are powered by meta-programming, so source-last is not necessarily the part contributing the most work towards Lopecode's overall experience.