Kotlin DSLs as a Single Source of Truth for Multiple Tasks
summary
Argues that Kotlin internal DSLs function as a single source of truth that can execute rules, generate live diagrams, docs and serializations, and run sanity tests. Shows a rules DSL that transpiles to Graphviz DOT for visualization, to Asciidoctor for documentation, and to YAML/JSON via Jackson; a 4‑condition example produces 2^4 = 16 cases and reveals unreachable rules, and brute‑force sanity tests remain fast up to about a dozen conditions. Demonstrates lambdas with receiver, DSL marker, infix/operator tricks and delegated property capture for identifiers, and notes executable‑code security and Kotlin parenthesis limitations.
AI-written summary · about
chapters (7)
- 0:00Kotlin DSLs introduction
- 7:19DSL types and tradeoffs
- 12:41Imperative to DSL evolution
- 21:26Executing and extending DSLs
- 33:27Advanced DSL techniques
- 44:33Cross references in DSLs
- 52:27Conclusions
related talks
44mKotlin DSL as a single source of truth for solving many tasks
46mCreating Internal DSLs in Kotlin
22mUse Kotlin DSLs for your Gradle scripts
10mpart6 – Neal Ford
44mJava Code Analysis with Database and Domain Specific Language
53mDeveloping DSLs in a pragmatic way
01h 04mGetting Started With Kotlin DSL in TeamCity: From Zero to Hero
23mUse Kotlin DSLs for Your Gradle Scripts
