diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 06:33:52 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 06:33:53 -0300 |
| commit | ffe05cceb897b3ae6a6d36491f9318a8aa3426e7 (patch) | |
| tree | 352414579559060b3e8486af34e29d49fd5df781 /docs | |
| parent | 5b7124d10f9b2db8d1c5e99eacb9b6d2fffff0cc (diff) | |
| parent | a403340ec5c90238b136ca85fc64d65809b29a65 (diff) | |
| download | pardes-ffe05cceb897b3ae6a6d36491f9318a8aa3426e7.tar.gz pardes-ffe05cceb897b3ae6a6d36491f9318a8aa3426e7.zip | |
integration: the build's second pass on the handle and the devices once: pardes-build-pass2 (pardes-isolate and the tree-sitter=disabled tier deleted; one option, grammars = none | minimal | full; build.zig with the consumer's lines as its head comment; test/lib -> test/consumer; the manual's library section) and pardes-merge31, merged without a textual conflict; one line follows a deletion: dev/file_watch.zig's end-to-end test of a session's watches (written since on the base) guarded on fs.platform_has_fs, which the first of these changes deleted: the guard reads as the file's other tests' (comptime !supported); tui core-test 857/1008 (151 skipped), shell-test 1048/1051, the window builds; the coordinator's gate in the ledger (reorg/merge32)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/next-editor.md | 4 | ||||
| -rw-r--r-- | docs/next-terminal.md | 2 | ||||
| -rw-r--r-- | docs/typ/building.typ | 81 |
3 files changed, 50 insertions, 37 deletions
diff --git a/docs/next-editor.md b/docs/next-editor.md index e7168256..4b62f6b0 100644 --- a/docs/next-editor.md +++ b/docs/next-editor.md @@ -72,7 +72,7 @@ registers before it writes anything. A ring never refuses: it drops its oldest snapshots, never part of one (an undo ring holds at least one whole text, checked at compile time). -**Measured** (test/lib `zig build bench`, a text in C's shape, a key typed +**Measured** (test/consumer `zig build bench`, a text in C's shape, a key typed into its middle, 200 keys, this machine): a key at 1, 16, 64 KiB is 13, 173 and 692 µs in Debug (270k, 3.1M, 12.2M instructions) and 0.7, 7.7 and 30 µs in ReleaseFast: the 64 KiB key is 4% of a 16 ms frame in Debug. A @@ -82,7 +82,7 @@ text's and the cursor's); the first after a jump moves the gap, 3, 5 and optimised in every mode): once a changed key, not a frame, so no incremental re-parse. -A package taking the editor (test/lib) compiles cold in 6.4 s (126e9 +A package taking the editor (test/consumer) compiles cold in 6.4 s (126e9 instructions), an edit of its own file in 0.95 s plainly and 0.09-0.11 s under `--watch -fincremental`. pardes itself: core-test's full recompile 238.8e9 instructions before and after; the typing cells of `zig build diff --git a/docs/next-terminal.md b/docs/next-terminal.md index ad21ef9b..a34fc0f2 100644 --- a/docs/next-terminal.md +++ b/docs/next-terminal.md @@ -161,7 +161,7 @@ The ptys stay host resources: - The records the terminal writes (cells, placements) live in the interface module, or in a leaf module surface.zig's types are moved into. surface.zig today imports `pardes.zig` (surface.zig:3), so its cell types have to be lifted out. - **Registration.** - main.zig hands the core `&term.ops` (`Pardes.Options.terminal`, or one global set at start beside `pardes.turn`). - - Every root that builds a product imports `term`: the exe, the static build, `run-isolated`, the gui. + - Every root that builds a product imports `term`: the exe, the static build, the gui. - `core_module` does not. build.zig's `wireCore` stops giving it ghostty-vt, wuffs and zstbi, and core-test's link loses `-lc++`. - **The no-terminal core.** A core with no terminal ops (only a test can build one) boots to a scratch pane and says once "no terminal in this build". Words that make terminals (`Term`, `Repl`, an exec with no idle shell) refuse in words. `takesCommandLine` is false. - **The test fixtures.** This is decided at Phase 1 from the count of tests that need a real shell, as opposed to the ones that merely boot one: diff --git a/docs/typ/building.typ b/docs/typ/building.typ index 8bfcb85b..d4732fa9 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -60,7 +60,7 @@ must share with its session; `pardes --help` lists every flag. [`-Dplatform`], [`tui`, `gui`, `macos`; absent: the tui and SDL shells together, installed into `~/.local`], [`-Dpdf`], [bool: build the pdf addon, fetching MuPDF the first time; default on once MuPDF is fetched, and off Linux], [`-Djpx`], [bool, `true`: JPEG 2000, and with it scanned PDFs], - [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full`], + [`-Dgrammars`], [the tree-sitter grammars compiled in: `none` (the runtime alone), `minimal` (C, C++ and Zig) or `full` (all of them; the default)], [`-Dembed-sources`], [bool, `false`: serve the sources under #file("/src")], [`-Dhome-install`], [bool: a bare `zig build` also copies the binaries into `~/.local/bin` and the addon steps theirs into `$XDG_DATA_HOME/pardes/addons`, default true; with `-Dplatform` only `true` copies, and the addons alone], [`-Dstamp-commit`], [bool: the git commit in `--version` and crash records; on for release builds and the `~/.local` install], @@ -92,23 +92,50 @@ moves an anchor fails that file's step. Each table says why, edit by edit. == As a library <library> -A Zig package that depends on pardes is given one module and nothing of -the editor: `pardes-syntax` (`core/lib_syntax.zig`), for a program that -draws source text itself and wants it parsed and coloured as pardes has -it. +As `build.zig`'s head comment says it, word for word: + +A package that depends on pardes is given its syntax, `pardes-syntax` +(`core/lib_syntax.zig`): ``` -// build.zig.zon -.pardes = .{ .path = "../pardes" }, -// build.zig const pardes = b.dependency("pardes", .{ .target = target, .optimize = optimize, - .@"tree-sitter" = .minimal, + .grammars = .minimal, }); exe.root_module.addImport("pardes-syntax", pardes.module("pardes-syntax")); ``` +and, when it asks, the text pane, `pardes-editor` +(`core/lib_editor.zig`), here with a grammar of its own handed in at +run time: + +``` +const pardes = b.dependency("pardes", .{ + .target = target, + .optimize = optimize, + .grammars = .none, + .editor = true, +}); +exe.root_module.addImport("pardes-editor", pardes.module("pardes-editor")); +``` + +`.grammars`: the tree-sitter grammars compiled in: `none` (the runtime +alone), `minimal` (C, C++ and Zig) or `full` (all of them; the default). +`.editor`: exports `pardes-editor` besides `pardes-syntax`, and with it +fetches uucode, mvzr and vaxis. + +Every dependency but tree-sitter's runtime is lazy in the manifest, so +such a package fetches what it asked for and nothing else. +`pardes-editor` has `pardes-syntax` in it as `.syntax`: a file belongs +to one module, so a package imports one of the two. `test/consumer` is +such a package, with both shapes; `lib-test`, which `unit-test` runs, +builds and runs it. + +`build.zig.zon` names pardes by its path: `.pardes = .{ .path = "../pardes" }`. + +=== The syntax + It is the editor's own code under the names it has there. A language is told by a path's extension, as in the editor, and `pathFor` gives a path for a language's name. @@ -122,35 +149,21 @@ for a language's name. [`start`, `stop`], [tree-sitter's allocator, and the end of the parsers kept per language], ) -The `tree-sitter` option is the build's own: `zig`, `minimal` (C, C++ -and Zig) or `full`, the default. Every dependency but tree-sitter's -runtime is lazy in the manifest, so the package fetches the runtime and -its set's grammars and compiles those alone; pardes's own build asks for -what it is missing in one round. Zig still unpacks a lazy package whose -archive its global cache already holds; `--pkg-dir` (or `ZIG_LOCAL_PKG_DIR`) -at pardes's `zig-pkg` shares the one copy. What a pane measures stays -out: a cell's width is vaxis's and uucode's, and a tab is -`config.tab_width` cells wherever it stands. `test/lib` is such a -package, and `zig build lib-test` builds and runs it. +pardes's own build takes `-Dgrammars` too, and asks for what it is +missing in one round. Zig still unpacks a lazy package whose archive its +global cache already holds; `--pkg-dir` (or `ZIG_LOCAL_PKG_DIR`) at +pardes's `zig-pkg` shares the one copy. What a pane measures stays out: a +cell's width is vaxis's and uucode's, and a tab is `config.tab_width` +cells wherever it stands. === The editor `pardes-editor` (`core/lib_editor.zig`) is the text pane as a library: helix's keys on a text kept in memory, no files, commands, builtins, -prompts or views. A package asks for it, and is then given uucode, mvzr -and vaxis's grapheme width besides; one that does not fetches nothing more. -It has `pardes-syntax` in it as `.syntax`: a file belongs to one module, so -a package imports one of the two. - -``` -const pardes = b.dependency("pardes", .{ - .target = target, - .optimize = optimize, - .@"tree-sitter" = .minimal, - .editor = true, -}); -exe.root_module.addImport("pardes-editor", pardes.module("pardes-editor")); -``` +prompts or views. Of vaxis it takes the grapheme width alone. With +`.grammars = .none` it has no grammar of pardes's: a program hands its +own in at run time (`Language`, below), linking the grammar's parser +itself, as `test/consumer` does with C's. The editor is a value of plain data, `Editor(capacity)`: no pointer, no allocator, every capacity in its type, so a program keeps it where it @@ -186,7 +199,7 @@ zig build kitty-harness kitty graphics through a pane end to end (a fake kitt kitten icat and chafa too when installed) zig build syntax-test tree-sitter tests without building the editor zig build syntax deterministic per-byte highlighting snapshots -zig build lib-test the library, from a package that depends on pardes (test/lib); +zig build lib-test the library, from a package that depends on pardes (test/consumer); unit-test runs it too zig build hxlib helix's cases on the library's editor (-- --parity: against the file pane) zig build behaviour-test behaviour through the 9P tree, in process (test/behaviour/), |
