Skip to content

The Evaluation Model

Live, you keep a session alive and grow it — evaluating a line here, a block there, each fragment landing in a runtime that remembers everything you’ve run so far. If you’ve used a DAW, the session is your project: you don’t rebuild it each time you touch a fader, you adjust the thing that’s already playing. This page is the mental model for how code becomes a living session. The other way to run a piece, a file run that renders it and exits, is in Two Ways to Run a Piece.

When a fragment finishes, nothing it made is torn down. A track it created stays loaded, stays playing and stays bound to its name, so the next fragment can simply talk to it — send it a new pattern, turn a parameter — without declaring anything again. That persistence, the runtime holding your variables, tracks, instruments and effects between evaluations, is the whole foundation of live coding in resonon.

It is also why re-running a line is safe. A track, a device on a track and a pattern slot are each identified by name, so running the line that made them again addresses what is already there instead of stacking a copy — see Descriptions & Slots. Names in the language work the same way: running a let again in a later evaluation rebinds the name, which is what lets you re-run a block you edited (Names & Live Editing).

Whether you select lines in VSCode, evaluate a whole file, type into the REPL or connect from several machines at once, every fragment goes to one long-lived runtime. Evaluating code live never starts a program; it evaluates a fragment against the live session. The editor is only a client — the session lives in a server process, which is why it survives a window reload (Sessions & Servers).

The transport is session-wide: PLAY, PAUSE and STOP move one play head for every track, and none of them touches the session. STOP returns to the start and lets tails ring out, the way it does in a DAW; your tracks, instruments and variables are all still there, ready to play again. What each statement does exactly is in Transport.

RESET is the heavy one. It clears the entire session — every variable, track, instrument, and effect — and tears down the scheduler, leaving you a blank runtime. It’s the live-coding equivalent of closing the project and opening an empty one: the right move when a session has drifted somewhere you can’t easily edit your way out of.