Do fish have legs: Language design for the commercial coder
summary
Builds a small DSL in Scala for backend search queries, implements an AST, a runtime evaluator and a static typechecker that rejects impossible queries like "fish has legs", and demos it working. Shows concrete rules: record and union types, subtyping, and branch-aware type refinement for if expressions. Implementation totals about 200 lines of Scala with a roughly 10-line evaluator, uses Scala for function dispatch, and successfully types and runs the example queries.
AI-written summary · about
chapters (10)
- 0:00Start
- 2:20Problem
- 7:04Evaluation
- 8:34Apply case
- 14:18Types
- 14:39Simplest type system
- 15:02Symbol case
- 15:58Restrictive type systems
- 16:59Rule 1 (revised)
- 18:09Further complications
related talks
45mDesign and Effectiveness of Internal DSLs in Scala
46mInventing a language (placeholder title)
24mDesigning a DSL That Perfectly Solves Your Problem
42mWhen your DSL Needs to Support User-Defined Functions
44mFunctional Interpreters and You
41mTeaching Domain Specific Languages in Scala
44mJava Code Analysis with Database and Domain Specific Language
45mTypelevel Programming 101: The Subspace of Scala
