Lyrebird 2.0.0 — Linux support

Consolidated release: the cross-platform Linux port (engine, generators, CLI,
REPL, NRT, portable DSP), live ALSA audio + ALSA MIDI + POSIX OSC + portable
WAV codec, the GTK4 GUI (LyrebirdUI on the SwiftOpenUI backend), and the Linux
live-coding scratchpad (LiveCompile). Apple platforms unchanged; all additive.
See RELEASES.md and LINUX_README.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-10 21:09:11 -07:00
parent 77580ee98e
commit b6fdee8bfc
293 changed files with 16800 additions and 775 deletions
@@ -15,9 +15,12 @@ Compile diagnostics from a failing snippet are parsed by `DiagnosticParser`
and rendered beneath the editor with line numbers already remapped from the wrapped
source back to the user's snippet coordinates.
The view is macOS-only — `LyrebirdLiveCompile` shells out to `swiftc`, which is
unavailable on iOS. The nested `LiveCompile/` sub-package declares
`platforms: [.macOS(.v15)]` and cannot be added to an iOS target.
`LyrebirdScratchView` (the `NSTextView` editor described here) is macOS-only, but
the scratchpad itself runs on **Linux** too, through a GTK4 counterpart —
`LyrebirdScratchLinuxView` / `LinuxScratchModel` on the SwiftOpenUI backend. Both
drive the same `LyrebirdLiveCompile` engine; only the editor UI differs. See
[Linux (GTK4)](#linux-gtk4) below. What is genuinely unavailable is **iOS**:
`LyrebirdLiveCompile` shells out to `swiftc`, which iOS does not provide.
> Note: **Swift mode needs a Swift toolchain** (Xcode or the Command Line Tools) —
> it compiles snippets with `swiftc`. At launch the app probes for one
@@ -442,9 +445,39 @@ row in the wrapped document. Completion is Swift-mode only — graph-DSL mode is
interpreted and needs no compiler — and best-effort: any LSP failure yields no
candidates rather than an error.
## Linux (GTK4)
On Linux the scratchpad is `LyrebirdScratchLinuxView`, driven by
`LinuxScratchModel`, on the GTK4 SwiftOpenUI backend (re-exported through
`LyrebirdUI`). It runs the same `LiveSession` compile→`dlopen`→run path as the
macOS view; the difference is the editor and its chrome:
- **Editor** — a `GtkSourceView` with Swift syntax highlighting, a line-number
gutter, and auto-indent (needs `libgtksourceview-5-dev`).
- **Completion** — **Ctrl+Space** at the caret shows sourcekit-lsp completions,
filtered by the identifier prefix already typed.
- **Run** — a *Run (fresh)* button clears the previous snippet's synths; *Run
(additive)* layers on top. Selecting one or more lines evaluates just those
(the selection is mirrored out of the editor).
- **Stop audio** — a panic button calling ``LiveSession/resetAll()``.
- **Live scope** — a `LyrebirdScopeView` of the session's output.
- **Save / load** — a native File menu (`New`, `Open…`, `Save`, `Save As…`) with
`Ctrl+N` / `Ctrl+O` / `Ctrl+S` / `Ctrl+Shift+S` accelerators, backed by
`GtkFileDialog`. Snippets are plain `.swift` files; `LinuxScratchModel` tracks
`currentPath` / `isDirty` and surfaces a `●` marker in the title. The File menu
commands are provided by `lyrebirdScratchFileCommands(model:)`, attached to the
hosting `WindowGroup` with `.commands` (SwiftOpenUI declares commands on the
Scene, so the app owns the model and shares it with
`LyrebirdScratchLinuxView(model:)`).
`LyrebirdScratchLinuxDemo` is the runnable entry point. Because a snippet links
the engine's dynamic libraries, run `swift build` in `LiveCompile/` before
`swift run LyrebirdScratchLinuxDemo`. See `LINUX_README.md` for the full setup.
## Limitations
- macOS only.
- Snippet compilation shells out to `swiftc`, so the scratchpad is desktop-only
(macOS and Linux); it is unavailable on iOS.
- Syntax highlighting is a lightweight built-in lexer (`ScratchSwiftTokenizer`) —
approximate by design, not a full parser. Completion (above) uses the real
compiler via sourcekit-lsp; the two are independent.