This presentation introduces "Amber," a new project by Jonathan Frech, which re-imagines a concurrent, self-similar window system for TTYs (Teletypes). Inspired by Rob Pike's Plan 9 window system "8½" and the underlying principles of Tony Hoare's Communicating Sequential Processes (CSP), Amber aims to address common graphical inconsistencies and unresponsiveness in traditional TTY-based interfaces. Implemented in Go, Amber leverages CSP's dynamic state management to contain combinatorial complexity and achieve precise concurrency semantics. The talk highlights the unique properties of TTYs that make them suitable for a CSP-driven approach, such as low frame entropy and the absence of a master clock. A live demo showcases Amber's functionality, including multi-window management, interactive elements, and robust handling of OS-level suspend/resume events. Frech concludes by outlining future goals, including network protocol definition via pseudo-terminals and the development of a more concurrent text editor based on Amber.
Summarizing "Amber: CSP-driven TTY"
0:00 Introduction to Amber: Jonathan Frech presents "Amber," a project inspired by Rob Pike's Plan 9 window system "8½" from 1991, which itself was a predecessor to Rio and Nile.
0:41 Inspiration from "8½": Frech expresses deep admiration for "8½" despite its inaccessibility on modern Unix systems due to its reliance on Plan 9's per-process file system views and unique /dev/bitblt device.
2:22 Core Principles from Earlier Work: "8½"'s core concepts of concurrency and self-similarity were present two years prior, implemented without the Plan 9 kernel, in a paper titled "A Concurrent Window System." Amber is an artistic study of these ideas.
3:03 CSP's Promise for UI: Communicating Sequential Processes (CSP) enables precise semantic handling of human-machine interaction. Unlike traditional event-stream systems that require manual unrolling of combinatorial interactions (leading to bugs), a CSP runtime scheduler can dynamically manage these interactions, ensuring precise and lexically defined semantics.
4:33 TTY Challenges: Frech highlights personal frustrations with graphical inconsistencies, bugs, and unresponsiveness in TTY-based graphical user interfaces, particularly in editors like Vim.
5:14 Amber's Definition: Amber is an implementation of a concurrent, self-similar window system, inspired by the discussed CSP ideas, driving the TTY as favored by Xterm.
5:32 Amber's Family Tree (CSP Lineage): The presentation traces the influence of CSP from Hoare's 1978 paper through Plan 9's rendezvous system call (analogous to CSP channel operations), various languages, and ultimately to Go (which incorporates CSP-like concurrency primitives), leading to Amber in 2024.
7:44 Concurrent Window System Structure: A concurrent window system involves a client that manages its own display capabilities (dimensions, charmap output) and input (keystrokes, suspend, terminate).
8:44 Special TTY Properties: TTYs have unique advantages for this model:
Low frame entropy allows shoving entire frames through channels.
Absence of a master clock means the system's concurrency can be fully delegated to the scheduler, receiving events as they occur.
The Ctrl+Z suspend capability can be modeled with a "triple channel" (possible in Go due to non-statically named channels and garbage collection), allowing full propagation of suspend/resume signals through the system.
11:12 Live Demo: A demonstration shows Amber managing a "coin process" within multiple nested windows. Users can interact with the coins (change height/angle, reset) from different nested windows. Resize events propagate seamlessly. The system correctly handles OS-level suspend (Ctrl+Z) and wake-up calls, demonstrating the full propagation of control signals.
12:43 Simple Implementation Core: The implementation is described as having a "very simple core," with termination signals (like Ctrl+C as a key event) propagating through the system. The use of reciprocal prime speeds for coin rotation highlights the scheduler's fine-grained time control for intricate concurrent systems.
14:15 Future Goals: Frech aims to use pseudo-terminals to enable a network protocol for the channel interface (emulating SSH's pseudo-terminal) and ultimately create a new, more concurrent text editor, building on Amber as its foundation.