Discover how to create type-safe and statically typed Domain-Specific Languages (DSLs) in Kotlin in this 45-minute conference talk. Explore the language features that enable DSL creation, examine practical examples, and build a simple DSL from scratch. Begin with an introduction to DSL-related Kotlin features, then participate in a live coding session to create and enhance a basic DSL. Analyze various examples, including JSON and XML builders, data binding, configuration, and template engines. Learn about extension functions, console strings, client creation, code simplification, scope control, DSL marker annotations, method invocation, and build configuration. If time allows, examine a Kotlin DSL example in the TeamCity continuous integration server.
Overview
Syllabus
Intro
What is DSL
Examples
Similarities
Structure
Transformation
Extension Functions
Console String
Create Client
Simplify Code
Comparison
Scope control
DSL marker annotation
Method invocation
Build configuration
Conclusion
Taught by
Devoxx