Skip to main content

Grammar

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.