What is this?
An interactive session for ghūl.
Type a cell and run it: it is compiled on the server and runs in your
browser, and whatever it defines stays available to the cells after it.
A cell that ends on a value shows it, after its type:
int: 500. The T: button turns the type off and on.
This is for a line or a definition at a time. For a whole program, use the playground.
Running a cell
- Run, or Ctrl+Enter, Shift+Enter or Alt+Enter from anywhere in the cell, runs it.
- A line holding only
.runs what comes before it. - Enter on its own starts a new line.
- Alt+↑ and Alt+↓ bring back earlier cells.
- ↻ beside a cell runs it again, as a new cell.
Showing a value as the cell runs
display(value) shows a value where the cell has got to, rather
than only the value it ends on. display(value, "name") shows it
under a name, and update_display(value, "name") redraws it in place,
so a long-running cell can report its progress on one line.
A value that can draw itself - a Raster.IMAGE, say - is shown
as its picture, whether the cell ends on it or displays it.
Stopping and starting again
While a cell runs, Run becomes Stop, which ends a cell that will not finish. Code running in the browser cannot be interrupted, so the session goes with it. The cells before the stopped one are then run again, without showing what they write, so what they defined is back; a cell that takes a long time does so again, and Stop stops the rerun too. A cell that does not come back this way, and every cell after it, is shown dimmed and struck through; ↻ beside it runs it again. New session starts an empty session on purpose.
Limits
A session holds 50 cells; once it is full, no more can be run until New session starts another. Cells are compiled on a shared server, so it limits how many one address can compile a minute.
While you type
Errors, hovers and completions come from the same analyser the playground uses, and know what the earlier cells defined.