Contents
The manual has three parts. The user guide gets you from installing Tersenet to reading, publishing and following others, with no programming. The implementation guide builds the parts of Tersenet yourself, from working source code: a reader, programs, a host, a device and a shell. Both are short steps, each one you can finish in a sitting. The reference is everything, complete and exact.
User guide
- Install Tersenet: one command on Linux and macOS, a zip on Windows, or from the source.
- Run Tersenet: the window, the launcher, the reader and this manual.
- Your feed without the command line: the window's own screens (F10): your key, your name, publishing, following and relays.
- Create your profile: your key, your name and your address, in a terminal; no account needed.
- Write and publish an article: a plain text file, how it compares with Markdown, and your feed.
- Read articles and follow links: the timeline, links and search.
- Subscribe to someone's feed: a shared relay, by address or by name, nicknames.
- Reply to an article: read the replies under an article, write one from the reader or a terminal.
- Find and play a game: the built-in game, programs from feeds and links, saving your place.
Implementation guide
- Make a reader: what a reader does, and a small one built in three steps, in Go or in Rust.
- Make a reader in Go, step 1: show an article: an article file's headings and paragraphs, with the standard library alone.
- Make a reader in Rust, step 1: show an article: the same program in Rust.
- Make a reader in Go, step 2: fetch an article: get an article from a relay by its ID and check its BLAKE3 hash.
- Make a reader in Rust, step 2: fetch an article: the same in Rust.
- Make a reader in Go, step 3: follow a feed: subscribe to a feed, check its entries' signatures strictly, open an article.
- Make a reader in Rust, step 3: follow a feed: the same in Rust.
- Write a program in C: hello on the text grid, built, run in a window and tested without one; Go has no compiler for Terse32, so the program pages are in C and Rust.
- Write a program in Rust: the same program with the Rust runtime.
- Draw a line and read a key: a line on the 2D vector display that the arrow keys move, in C.
- Draw a line and read a key in Rust: the same with
VecList. - Make a small game: steer a dot to a ring, keep score; the way to sparks and Lumen Reef, in C.
- Make a small game in Rust: the same game in Rust.
- Test your program in its window: a script drives a C or Rust program in its real window and checks what it shows.
- Make a host: what a host is, and the four steps in Go and in Rust.
- Make a host in Go, step 1: run a program to its end: the program file, memory and the processor, until
exit. - Make a host in Rust, step 1: run a program to its end: the same in Rust.
- Make a host in Go, step 2: frames and the budget: 125,000 units a frame,
wait_frameand the carry rule. - Make a host in Rust, step 2: frames and the budget: the same in Rust.
- Make a host in Go, step 3: a driver shows hello: the reference terminal over the device bus.
- Make a host in Rust, step 3: a driver shows hello: the same in Rust.
- Make a host in Go, step 4: prove it exact: the state hash, equal to the reference's.
- Make a host in Rust, step 4: prove it exact: the same in Rust.
- Make a device: a device as a separate program on the device bus.
- Make a device in Go: a terminal driver enough for
hello, under the reference core and the example hosts. - Make a device in Rust: the same in Rust.
- Swap in your own part: your reader, core or device with the reference for everything else.
- Make a shell: a program that starts another machine and shows it (device 8), in C.
- Make a shell in Rust: the same shell with the runtime's calls of device 8.
- Invent a device: an experimental device, its driver in C and a program in C that uses it.
- Invent a device: the program in Rust: the same program in Rust, with raw calls.
Reference
Tersenet as a whole:
- How Tersenet works: sharing articles and programs, the network, the machine, the devices, determinism and the shell.
- Using the shell: the desktop, its windows and keys, sessions, halted machines, open requests and consent prompts.
- The tiling shell:
--shell tiles: the bar, the launcher, the tiles, layouts and the gallery. - Using the reader: the timeline, feeds, search and reading an article, with every key.
- Fonts: the fonts the host draws with, which characters they show, and adding one.
- Performance reports: what a report of your host's record holds, publishing one, and reading many.
Articles and the network:
- Writing an article: the article format, every construct shown as source and as shown.
- Writing a reader without the machine: what a native reader must do to be a complete Tersenet client.
- The network: blobs and relays, feeds and entries, feed addresses, several relays, mirroring relays.
- Profiles, names and search: profiles and display names, nicknames, search and lookup.
- Replies: an article in reply to another, how relays index and page them, how clients merge and show them.
- Relays: encryption and trust: encrypted unless written otherwise, plain relays, private authorities and pinned keys.
- Signatures and valid entries: the entry's bytes, every rule and its reason, strict Ed25519 verification, what libraries do, the test vectors and the SDK.
Programs:
- Building a program:
terse buildandterse new, every option, what they run and why, the devices an image lists. - The C library: the start code, the linker script, terse.h, and the hello program in assembly and C.
- Rust programs: the Rust runtime, what things cost, a larger program with cargo.
- Building by hand, and other languages: the build without
terse build, and what any compiler must do. - Running and publishing a program: headless runs, scripted input, the state hash, the window, costs, publishing.
- Testing a program:
terse run's dumps and hashes, andterse-host --drive: the window driven by a script, every command and expectation.
The Terse32 machine:
- The Terse32 machine: the CPU, the memory map, frames and the budget, faults, the image format, calls.
- The call table: every call of every device, its number, arguments, result and class.
- Events and input: every event, the queue, keys, text, the pointer, the wheel and controllers.
- Charges and limits: every charge and every numeric limit on one page.
- State, replay and conformance: the machine's state, its hash, snapshots and the conformance image.
The devices:
- The system device (device 1): frames, events, time, random bytes, controllers, exit, opening things.
- The terminal (device 2): an 80 by 30 grid of character cells.
- The 2D vector display (device 3): lines and filled shapes from a display list, clean or phosphor.
- Content: blobs, requests and statuses (device 4): fetching and publishing blobs by hash.
- Content: feeds, names, search and publishing: the feeds the host follows, names and search.
- Content: replies: the replies to an article, the article a reply answers, writing and publishing a reply.
- Content: named records: small named records a program keeps on the host.
- The sound device (device 6): a 16-voice wavetable synthesizer, optional and bit-exact.
- The page (device 7): typeset proportional text and tables in a rectangle of the screen.
- Figures on the page: drawings within the page's text.
- The Machines device (device 8): the shell's device, which starts other machines.
- The system frame, snapshots and state (device 8): the order of a system's frame, snapshots, determinism and charges.
- Screens, panels and input (device 8): where machines' screens go, flat or as panels in 3D.
- The 3D vector display (device 9): lines, points and circles in a box, seen from the host's eye.
- Caps, presentation and state (device 9): clipping, how much a list may draw, how it is shown, charges and state.
- Surfaces: a program's own screen placed in its 3D scene.
- The reference host's look: how terse-host draws the phosphor style, the 3D eye and the shell; a description of one host, not a requirement.
- Experimental devices: slots 240 to 255, a name, optional only: a device tried out before it is specified.