Teaching Domain Specific Languages in Scala
summary
Course-style report on teaching DSLs using Scala 3 that shows concrete tools, assignments and outcomes: covers external DSLs with parser combinators (Parsley/parboiled discussion), internal DSLs via extension methods, symbolic operators and fluent builders, and Scala 3 metaprogramming using quotes/splices to generate compile‑time checks (examples: four‑letter command literals, duplicate initial‑state errors). Students implement parser+semantic model, optional generative macros, and VS Code integration via Scala.js for VS Code extensions (breadcrumbs, rename, go‑to, code lenses). Expect demos, library choices, and one or two high‑effort student projects per year.
AI-written summary · about
chapters (27)
- 0:00Introduction
- 1:25What are DSLs
- 2:51External DSLs and workbenches
- 3:55Focus on internal DSLs in Scala
- 5:42Teaching Scala via domain modeling
- 7:08Security system domain model
- 9:57Semantic models in Scala
- 11:04External DSLs with combinators
- 12:28Parsing DSL syntax and semantics
- 14:15Advanced Scala features
- 15:41Internal DSLs and fluent APIs
- 16:22Operator overloading and extensions
- 18:11Builder patterns and fluency
- 19:16Call-by-name and guards
- 20:39Contextual abstractions
- 22:47Generative DSLs and metaprogramming
- 24:10Macros for compile-time DSLs
- 26:19Rewriting syntax to semantic model
- 28:50Type-dependent assertions
- 30:39Type providers for DSLs
- 32:29Advanced assertion DSL
- 33:11IDE support for external DSLs
- 35:03Scala.js with VS Code
- 37:13Language features in VS Code
- 38:41Summary and synergies
- 39:43Limitations and future
- 40:45Q&A
related talks
37mLessons from Teaching Scala to 80,000 People
45mDesign and Effectiveness of Internal DSLs in Scala
48mTechniques for Teaching Scala
35mFrom Zero to Three - Building a User Friendly DSL with Scala 3
48mTeaching Scala A Roundtable Discussion
09mScala Parser Combinators: The Easier Way to Create an External DSL
22mTeaching Scala to the statically challenged
30mLessons Learned from 15 Years of Scala in the Wild
