Skip to main content

Posts

2026

Todo TUI in Rust 2. Rendering the View layer with ratatui

·5 mins
The rat starts painting. We implement the rendering layer: immediate-mode drawing, a three-zone layout with Layout::vertical, a task table with StatefulWidget and row highlighting, a context-sensitive command bar that changes with InputMode, and the subtle Block gotcha that cost a few minutes of debugging.

Todo TUI in Rust 1. Scaffolding the TUI adapter and designing the state machine

·8 mins
We start a new series by migrating the CLI adapter to a ratatui TUI. We set up the new dependencies, design the module structure under adapters/tui/, model the interaction modes as an enum to make invalid states unrepresentable, and solve the ownership puzzle of cloning a repository in a persistent session.

Connecting OpenCode to GitHub MCP Server

·5 mins
A practical guide to connect OpenCode with the remote GitHub MCP Server using a PAT, disable automatic OAuth, and avoid the most common auth errors.

Syntax and Semantics 3. The Expression Problem

·6 mins
Adding a new type is easy in OOP, hard in FP. Adding a new operation is easy in FP, hard in OOP. Philip Wadler named this the Expression Problem in 1998. We show how it manifests in Rust and Scala, and tease the resolution.

Syntax and Semantics 2: Three ways to define what your code means

·7 mins
Your match expression is operational semantics. Your pure function is denotational semantics. Rust’s borrow checker is axiomatic semantics. Three formal frameworks, three ways to assign meaning to code, and you have been using all of them without knowing it.

Syntax and Semantics 1: Your code has a grammar problem

·6 mins
Every enum you write is a formal grammar. Every sealed trait is a set of production rules. You have been doing formal methods all along; you just did not know the name. We trace the connection from Chomsky’s hierarchy to your domain types in Rust and Scala.

Todo CLI in Rust 5. Next step moving from CLI to a TUI with ratatui

·12 mins
We close the series by exploring what it means to migrate from CLI to TUI with ratatui: how the interaction model changes, what frictions Rust introduces with ownership and &mut in a persistent event loop, and why hexagonal architecture absorbs the change without surgery.