Browser

What it is

The machine compiled to WebAssembly, with its modules linked in. The live code boxes are its small build, ose-lite.js; the playground is its full build, with a halted machine opened as a tree you can edit; and the view is the network drawn as cards, served by the command line beside it.

Get it running

Needs emscripten on the path.

git clone --recursive https://github.com/asomadev/web.o.se
cd web.o.se && make && make serve  # http://localhost:8000/

Inside a clone of the asoma workspace, the same host is hosts/web.o.se: make -C hosts/web.o.se.

First program

Open the playground, type (21, 2) /o/add and press Run; it answers : 23. Nothing is installed; the machine is in the page.

What it adds

Into the host register: WebAudio as /audio/* (create, connect, set, ramp, start, stop, at, level, read, and the rest), and a WebSocket as /send, so a program can make sound in the tab and talk to whatever is on the other end of the socket.

Loops run in the tab. ({ body }, ms, "/name") /continue/every puts a machine of its own in one of the page’s four slots, one per name; the page runs what is due and sets a timer for the next thing, so /continue/after inside a body pauses that loop’s period and ("/name") /continue/stop ends it. A loop is a machine, not a callback: the page can hand it to another host mid-flight, and a loop whose period fails is parked in its slot as it was at the fault.

The playground has panes beyond the program and its machine: a world pane, listing each name a loop called that nothing in the page binds and what it was answered; a nodes pane, where a program dropped on a node runs there; and snippets, kept as /snippet/<name> and dragged onto nodes. ?ws= in the page’s address names the socket to open. The socket’s other end is a bridge at the command line, tools/ws-bridge.sh in unix.o.se; tools/view.sh there starts the bridge, the census and this page in one command.

And, in the full build, the osen reference as data: the register /_q, one entry per name, so /_q/o/add answers /o/add’s entry. The code boxes on these pages run a smaller build without it.