Urgent.News

the world's headlines, one feed

Editions

Tech

Program images and portable Scheme backends for Jolt

Abstract editorial illustration

Jolt recently introduced two features that decouple the program from the host runtime. The first feature allows for serializing program images in the style of Common Lisp and Smalltalk. The second feature provides a portable Scheme layer that is decoupled from the Chez runtime.

Logging is a common practice for capturing program state during runtime errors. However, logging often requires developers to guess the question they want to answer before collecting the relevant data. This approach leads to over-logging and creates noise, making it difficult to trace the actual issue. By using Jolt's image/dump! function, developers can dump the entire program state when an error occurs, which can be loaded into a REPL to inspect the program's state at the time of the error.

The program image contains all the necessary information to debug the problem, including maps, records, cycles, shared structure, and even callable functions. This approach allows developers to ask a broader set of questions than traditional logging can provide, without having to know the questions in advance. The program image acts as a black box recorder, storing the instrument states to allow investigators to decide what to look at afterward.

However, open resources such as sockets or file ports cannot be serialized by default. Jolt resolves this issue by writing these resources as stub records during the image dump. Once the image is restored, developers can list the stubs and either register a resolver to reopen them or manually replace live values in the REPL.

Another interesting application of program images is facilitating collaboration. An image can be handed to another person, allowing them to load the state and interact with the running system directly. This approach enables real-time debugging and testing without the need to rebuild or seed the system. Jolt's image approach brings the benefits of Smalltalk and Lisp machines to modern programming languages like Clojure and Scheme.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

Read the original at yogthos.net →

More in Tech