From 3f1533813b6692a736251e4d467a7f108229ddee Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 11:40:11 -0300 Subject: targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- docs/typ/building.typ | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'docs/typ') diff --git a/docs/typ/building.typ b/docs/typ/building.typ index da704fe8..972b8a97 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -18,7 +18,6 @@ builds MuPDF and is on by default (`-Dmupdf=false` drops it). [`zig build`], [the terminal shell and the SDL window together, *installed into `~/.local/bin`* (`pardes` and `pardes-gui`)], [`zig build -Dplatform=tui`], [the terminal shell alone], [`zig build -Dplatform=gui`], [the SDL3 window alone], - [`zig build web -Dplatform=web -Dtarget=wasm32-freestanding -Ddump=`], [a freestanding wasm core plus vanilla JavaScript (`docs/web.md`)], [`zig build -Dplatform=macos`], [an AppKit and CoreText app over a static `libpardes.a` (`docs/macos.md`)], ) @@ -37,11 +36,11 @@ must share with its session; `pardes --help` lists every flag. `zig build --help` lists the options for the selected platform. #pairs( - [`-Dplatform`], [`tui`, `gui`, `web`, `macos`; absent: the tui and SDL shells together, installed into `~/.local`], + [`-Dplatform`], [`tui`, `gui`, `macos`; absent: the tui and SDL shells together, installed into `~/.local`], [`-Dstatic`], [bool, `false`], - [`-Dmupdf`], [bool; on natively, off for web], + [`-Dmupdf`], [bool, `true`], [`-Djpx`], [bool, `true`: JPEG 2000, and with it scanned PDFs], - [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full` natively, `zig` for web], + [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full`], [`-Dembed-sources`], [bool, `false`: serve the sources under #file("/src")], [`-Dhome-install`], [bool: a bare `zig build` also copies the binaries into `~/.local/bin`; default true], [`-Dstamp-commit`], [bool: the git commit in `--version` and crash records; on for release builds and the `~/.local` install], @@ -50,7 +49,6 @@ must share with its session; `pardes --help` lists every flag. [`-Dprebuilt-shaders`], [bool: embed the committed SPIR-V; on for a bare `zig build`, off with `-Dplatform`; `zig build shaders` refreshes it with glslc], [`-Dtracy`], [path to a Tracy checkout; off], [`-Dmacos-identity`], [codesigning identity for `pardes.app`; `-` (ad hoc)], - [`-Ddump`], [a Dump to embed in the web shell], [`-Dtest-filter`], [run only tests whose name contains it; a filter that matches nothing fails], [`-Dtest-rebuild`], [bool: fresh Zig test compilation], [`-Dhelix-harness`], [reference executable for live differential tests; `HX_HARNESS`, else `hx-harness` on `PATH`], @@ -84,8 +82,6 @@ zig build hxparity file-pane vs pty-pane editing parity zig build hxgolf every helix-golf example, step by step, against helix zig build perf-gate a gesture on the 50k-line file over 3x its baseline fails zig build mupdf-check compile, link, render and search docs/design.pdf -zig build web-snap browser highlighting and touch interactions -zig build web-e2e Chrome-driven DOM end-to-end suite zig build cheatsheet render the cheatsheet PDF (needs typst) ``` @@ -121,7 +117,7 @@ zig build cheatsheet render the cheatsheet PDF (needs typst) A release passes all of these first: `unit-test` with `-Dplatform=tui` and with `-Dplatform=gui`, `core-test`, `behaviour-test`, `process-test`, `snap`, the GUI goldens (`zig build gui-golden -Dplatform=gui`, a hidden window; `PARDES_GUI_GOLDEN=update` rewrites them), -`web`, and the ReleaseSafe tui and ReleaseFast gui builds. The committed +and the ReleaseSafe tui and ReleaseFast gui builds. The committed `docs/typ/cheatsheet-a4.pdf` is rendered again when the docs change. = Sending patches @@ -134,7 +130,7 @@ Mail patches to the list `~gbrls/inbox@lists.sr.ht`; it is the preferred way to = The core and its shells -One core, four shells (tui, gui, web, macos). The core owns +One core, three shells (tui, gui, macos). The core owns editing, layout, rendering and the virtual filesystem it serves over 9P; a shell turns native input into `pardes.Event`, presents `pardes.Surface`, and performs host effects such as spawning processes. @@ -155,15 +151,14 @@ effects such as spawning processes. - `host_io.Host` is a context pointer and a vtable of optional callbacks; a null method is not an error, and `Host{}` is a complete in-process pardes that the tests use. Comptime decides what a build has (`pardes.platform`, - `hosted`, `can_attach`, `pdf_enabled`); the vtable + `can_attach`, `pdf_enabled`); the vtable decides who serves it. - The root module is chosen by platform: `main.zig` (tui, gui), - `web.zig`, `macos.zig`. The web and macOS shells are - libraries whose host owns `main()`. + `macos.zig`. The macOS shell is a library whose host owns `main()`. - `memory.limits` is the one home for the core's capacities (selections, the tag's bytes, undo, the arenas' regions). Each core - allocator is a thread-safe stack-fallback allocator, under a - DebugAllocator in Debug builds. + allocator is a DebugAllocator over its arena's reserved region, thread + safe, its checks in Debug builds only. Code map: `src/panes.zig` and the pane kinds it names (`src/File.zig`, `src/Terminal.zig`, ...), `src/layout.zig`, `src/fs.zig` (host access, @@ -188,7 +183,7 @@ selection-pipe workers post completions through a bounded mailbox; a `host_io.Lsp.Job` owns copies of the source, path and arguments, never reading the live core, and a request id, the pane's serial and (for an edit) the file's revision reject a stale reply. A process that never calls -`turn.start` (the tests, the browser) has no second thread. +`turn.start` (the tests) has no second thread. == The daemon and detached sessions @@ -310,7 +305,7 @@ the hint. = Other notes `docs/` keeps the platform and design notes beside this book: -`web.md` and `macos.md` (the browser and macOS shells), `effects.md` and +`macos.md` (the macOS shell; `web.md` says what the browser shell was), `effects.md` and `render-pipeline.md` (visual effects), `helix-keys.md` and `selections.md` (helix parity), `lsp-evaluation.md`, `ui-review.md`, `divergences.md` (bookmarks off `main`) and `open-questions.md`. `next-steps.txt` is a wishlist and -- cgit v1.3