Skip to main content

Rust

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.

Todo CLI in Rust 3. JSON persistence, contract vs implementation

·18 mins
Third part of the series: we define the persistence contract with a generic trait, implement two adapters (in-memory and JSON to disk), and delve into the difference between interface and implementation as the axis of hexagonal architecture.