A notebook of shared cells

Cells share one engine, a hidden setup, a folded prelude, and outputs that follow the code.

Framework decisions behind it: D49, D63, D64.

Each run is a fresh program. A cell gets what it needs from a hidden setup and a folded prelude, and a later cell carries an earlier cell's code in its prelude, so it can use it. Both cells have the same scope, so they share one engine: Lua starts once. A pane under a cell shows the Lua bytecode of its code, and updates as you type.

Two cells, one engine

  1. Run the first cell. It defines and calls cube.
  2. Run the second cell. Its folded prelude holds cube, so it can call it.
  3. Edit the first cell. The bytecode pane changes without a run.
function cube(x) return x * x * x end show("cube(3)", cube(3))
Bytecode of this cell
show("cube(cube(2))", twice(cube, 2))