Design and Effectiveness of Internal DSLs in Scala
summary
Demonstrates how Scala features enable compact internal DSLs by actually building them: adds implicit classes to extend Double into 10.km/5.miles, uses symbolic method names and infix calls with defined precedence for expressions like 10.km + 5.miles, implements a testing DSL with plus/minus tolerance and approximate equality, integrates ScalaTest/ScalaCheck and the Squants-style units library, and uses macros for matcher generation (and reflection) to produce compile-time checked matchers; notes Dotty/Scala 3 changes (given, explicit extension methods, improved macros).
AI-written summary · about
chapters (13)
- 0:00Introduction
- 0:48Domain
- 1:47Domainspecific languages
- 9:32Domain of Logistics
- 10:24Implicit Class
- 18:08Priority
- 27:58Implicit values
- 29:21Demo
- 33:06Reference Framework
- 35:20Advanced Feature
- 36:16Meta Programming
- 38:18Specs
- 40:29Whats next
related talks
28mGrowing a DSL for financial calculations
41mTeaching Domain Specific Languages in Scala
35mFrom Zero to Three - Building a User Friendly DSL with Scala 3
41mReconstructing Scala
09mScala Parser Combinators: The Easier Way to Create an External DSL
30mLessons Learned from 15 Years of Scala in the Wild
42mAvoiding macros with inline and derived
49mFrom DOT to Dotty
