A RISC-V machine in a cabinet: eight chip slots, two floppy drives, a screen, and the violet bus pin. It runs off the server's main thread, and costs almost nothing while it waits.
(disk/format :a "LABEL").
Right-click a floppy in your hand to flip its write-protect tab. Rename it on an anvil to label it.The run lamp on the front: bright green while it works, dim green while it waits, red when halted, dark when off.
The screen is drawn by your own client, so nothing you do on it waits for the server (see
Wire, the Window Protocol). It starts at 80 by 25 characters: the menu bar on top, and
windows on a desk below. (ui/mode 120 40) in the Shell switches it to 120 by 40, and (ui/mode 80 25) back; open
windows stay, made smaller if they must be. Drag a window by its title row, size it from its bottom right corner, click it to bring it forward. Of
the boxes in its title row, the one at the left closes it, the one at the right sends it to the back, and the one
beside that minimises it to an icon on the desk (double-click the icon to bring it back). The menu bar shows the menus of the
window you last clicked. Click a menu's name to open it, then click an item (or press on the name, drag to the item
and let go). An item marked Alt-K is also picked by Alt and that letter, without opening the menu. Escape closes an
open menu. The first menu, Dynamo, lists every window, minimised
ones in brackets: pick one to bring it back. Its About Dynamo names the system. Several players at one computer share its desk.
With the Janet ROM:
(edit "a:/main.janet") opens a file with Janet's colours. Ctrl+S saves it, and if the file changed
on the disk since you opened it, the save is refused once: press Ctrl+S again to overwrite. Run runs the
saved file as a process, and Close closes the editor. Files over 32 KB can't be opened in it. (files) lists a floppy's files: click one to edit it.(inspect) lists the processes and their tasks. Click down into a task's stack, a frame's local
values and what is inside them. Back goes up, and REPL here opens a Shell inside that program, to look
around and change it while it runs.Ctrl+C in a window stops what runs there: the Shell's current form, or every task of that window's program. Reset starts the computer again from slot 1, and the power button turns it off (its RAM is lost) or on. Your half-typed lines and unsaved edits stay with you when you close the screen.
With the Janet ROM, the computer looks for startup.janet on drive A, then on drive B, and runs the first it finds
as a process with its own window; the Shell then waits as an icon. A floppy with main.janet instead runs it in one window filling
the screen, with no desk: the way to build a machine that does one job. That is how a program survives a restart: keep
it on a floppy as startup.janet or main.janet.
Saving the world keeps a running program where it was. A mod update that changes a ROM restarts every computer that
uses it, which runs startup.janet again.
In drive A at start-up (or in B, if A has no startup.janet) it turns the screen into Dynamo's desk, over a picture of poles along a road. The desk is
made from what is in the drives, never saved: the drives that hold a disk top left (A:, B:, and RAM:, a 192 KB
ramdisk that is empty at every start and gone at a reset or power off), the Shell, then every application found on them. An application is a directory named
NAME.app holding main.janet (what runs) and icon.pix (its icon), at a disk's top or one directory down: copy
one to another floppy and it shows up there too. The desk looks at the drives every two seconds. Double-click an application to start it (one of each: a running one
comes back instead), and a drive to open it in the Filer: click a name to choose it, again within two seconds to open it, and use
its menus to copy files to A:, B: or RAM:, rename, delete, make drawers (directories) and format.
Click the desk itself for its menus: Desk opens the Shell (Alt-S), looks at the drives again (Alt-R) or opens a drive's Filer, and Screen switches between 80 by 25 and 120 by 40 (a star marks the one in use).
+ - * / %, Enter and Backspace (C clears). The tape on the right
keeps your sums./board NAME opens or starts a board, and /name NAME signs your posts. Each computer keeps
every post it has seen on its floppy, so the boards live on while computers come and go. Posts can't be edited or
deleted.Click a game's field before you play, so it gets the keys.
A ready-made controller for the elevator of the RS485 page. Put it in drive A, then:
(edit "a:/main.janet") and change settings at the top:
* the drive's address,
* the floors' heights in blocks above the drive's foot, lowest first,
* each floor's landing button address, and its car panel button (nil where there is none),
* how long the car waits at a floor.Each pressed button lights up until the car arrives. The car carries on in its direction while there are calls ahead, and turns round when there are none. A fault or stall shows in its window, and the car tries again.
The Janet library · The Screen Protocol · Back to the reference