The machine on one page
ortferoWhat the machine is made of, how it comes up, how loom lays out its windows, and the commands that operate it, which help prints at the prompt too. The keys are in the keys codex, the hardware in the aldan codex and the instruction set in the riscv codex.
The machine is built in layers, lowest first.
| Layer | What it is |
|---|---|
| Machine | A 64-bit RISC-V computer with 16 MB of memory: a screen, a keyboard, a disk, sound, a network and a host directory |
| Firmware | The boot ROM. It owns every driver and publishes one call table |
| Almac | The resident binary, and the only one: the language, its compiler and the emergency prompt |
| Aldos | The task, memory, volume, file and service managers, written in almac |
| Core | The library every program draws on |
| Programs | The applications, loom among them |
| Path | What it is |
|---|---|
| /a | The boot disk, read-only |
| /b | The directory aldan in the host's home directory |
| Path | What it holds |
|---|---|
| /a/almac.bin | The resident binary |
| /a/rc.alm | The start-up script |
| /a/rc | The module the commands come from |
| /a/core | The core library |
| /a/aldos | The operating-system modules |
| /a/modules | The applications |
| /a/codex | The documents, this one among them |
| /a/samples | Pictures, tunes and recordings |
Drive /a is the system as it was built, one pack archive on the disk. It is read-only: an update replaces it whole, and a write to it is refused. Keep your own files on /b.
A path that does not begin with a slash is relative to the working directory. A dot is the working directory, two dots its parent.
A fault in rc.alm is reported as a module, a line and a reason, and leaves the machine at the emergency prompt; loom typed there goes back to the environment.
Loom is the environment, and the only prompt a working machine shows.
Every app is a window of its own, with a fiber of its own, so a slow one never holds up another. The display shows one window or two: two halves side by side when it is wide, one when it is narrow (a phone held upright).
| Window | What it holds, and the line that opens it |
|---|---|
| Repl | What the prompt has said, and the input line; always there |
| Files | A listing of a directory, up to four: files |
| Editor | A document: edit 'path |
| Viewer | A text file, read only, up to four: view 'path |
| Reader | A markoff document, up to four: read 'path |
| Picture | One picture, half or whole: look 'path |
| Drawing | One plot drawing, half or whole: plot 'path |
| Music | A tune or a recording: play 'path |
| Journal | What the services write: journal |
| Debugger | A session of the debugger: launch "line" |
| Keys | The keys codex, at the window's section: f1 |
Of the picture, the drawing, the music, the journal and the debugger there is one window each: opening another thing in it brings that window up holding it. A codex opens in a reader with help 'name: keys, aldos, aldan, almac, snippets or markoff. The viewer shows any text file as written, a markoff document among them; the reader takes a markoff document and nothing else, and renders it: paragraphs flow to the reading column, tables are drawn with box pieces.
Whatever is typed at the prompt is almac. A command is a function, called by its name.
> cd '/a/codex > cp 'aldos_keys.moff, '/b > edit "/b/my notes"
| Command | What it does |
|---|---|
| ls | List the working directory |
| lsd 'path | List a directory |
| cd 'path | Change the working directory |
| cd '. | Say the working directory |
| cat 'path | Print a short text file |
| touch 'path | Create an empty file |
| mkdir 'path | Create a directory |
| rmdir 'path | Remove an empty directory |
| rm 'path | Remove a file or a tree, for good |
| cp 'a, 'b | Copy a file or a tree |
| mv 'a, 'b | Move or rename a file or a tree |
| Command | What it does |
|---|---|
| edit 'path | Open a document in an editor |
| view 'path | Open a text file in a viewer |
| read 'path | Open a markoff document in a reader |
| save | Write the last editor's document |
| compile | Compile the last editor's document |
| import 'path | Compile a module and bind its names |
| Command | What it does |
|---|---|
| help | List these commands |
| help 'keys | The keys of every pane |
| help 'aldos | The system and its commands |
| help 'aldan | The hardware and its registers |
| help 'riscv | The instruction set |
| help 'almac | The almac language report |
| help 'snippets | Almac by example |
| memory | What the memory pool is doing |
| services | List the running services |
| stop 'name | Stop a service |
| reset | Rebuild the image from rc.alm |
| reboot | Start the machine again |
| halt | Power the machine off |