Graphics Livecoding in Common Lisp

https://news.ycombinator.com/rss Hits: 23
Summary

Graphics livecoding in Common Lisp 2025-04-23 Developing a Boids program from scratch without restarting it. Tags: lisp programming artsy << previous Some Lisps, like Common Lisp, have a powerful feature that tends to go underappreciated amidst all the talk about macros: the ability to recompile your program while it's running, without restarting it. For the purposes of this post, and because it sounds cool, let's call this ability livecoding. Entering this strange land where the programs never stop, we'll first take a brief tour of Common Lisp and one of its graphics frameworks, Sketch, before walking through a livecoded implementation of the Boids algorithm. Boids! "Wait, what exactly is this livecoding thing?" Consider the typical workflow needed to modify a running application, like a videogame. Stop the application. Change the code. (If a compiled language) Wait N time units for a full recompilation. Start the application again. Fiddle with the application to get it back to its previous state. Carry on. In a livecoding environment, the application is never stopped, which eliminates steps 1, 4 and 5. Instead, small code changes (which can be as granular as recompiling a single function) are immediately reflected in the running program. Step 3 is often instantaneous because only the changed parts of the program must be recompiled. In theory, then, you can develop an entire application while it continuously runs in the background, without ever waiting for code to recompile. This makes the development process more fluid and interactive, with minimal downtime. In Common Lisp, the workflow might look something like this: Make a small change to a single function. Recompile the function (instantaneous). Carry on. For an example of this workflow in action, check out Common Lisp and Emacs being used as an environment for live musical performance. You can hear about a Lisp program being debugged remotely while running in deep space. Livecoding (or hot reloading, or whatev...

First seen: 2025-04-23 18:47

Last seen: 2025-04-24 16:51