diff options
| author | eunhhu <[email protected]> | 2026-09-27 19:30:25 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-27 19:30:25 +0100 |
| commit | d72f57af85bb57042332da8bc002a2a0640639a0 (patch) | |
| tree | b1a0ad2b798da32532f47ee431ca5ee24ec9f1ca /prototypes/live-rules/runtime.mjs | |
| parent | 6d276be51ba89b04a60bb16b5179c015ad202c7c (diff) | |
| download | pure-d72f57af85bb57042332da8bc002a2a0640639a0.tar.gz pure-d72f57af85bb57042332da8bc002a2a0640639a0.zip | |
Run a surface for people inside the node (design 010)
pure-serve --surface LIBRARY [-- ARGUMENTS] maps a library and runs its
pure_surface_run in a thread of its own (serve/surface.h). The surface
reads the app as of the last save where it is, a published snapshot in a
reader app, as a connection thread reads views; an eventfd tells it of
each new snapshot; and its events (a key pressed, text typed) are
requests without a host in the owner's queue, applied and saved with the
round, their results handed back to the surface's waiter. So one node
serves programs over HTTP and people on its display with one owner of
its states, and nothing between the states and the screen. pure-serve
exports its pure_* functions for the surface to call, one copy of the
app model in the process; the table carries sizeof(PureApp) and
sizeof(PureModule) so a surface built for another layout refuses.
The check builds a probe surface that types, presses and reads: its
events show in HTTP views, an HTTP input shows in it, wrong inputs are
refused, it stops with the server, and a module without states cannot
have one. Without a surface the request path measured the same (small
GETs 140.9k vs 139.9k, app totals 126.3k vs 126.3k over eight rounds);
the exported symbols cost 11 KB of the file and 24 KiB idle.
Diffstat (limited to 'prototypes/live-rules/runtime.mjs')
0 files changed, 0 insertions, 0 deletions
