Learn how to create type-safe and statically typed DSLs in Kotlin. Uncover the language features that makes DSL creation possible. We’ll take a look at a few practical examples and create a simple DSL ourselves.
As Kotlin programming language is getting more popular, the creators of the libraries are starting to provide Kotlin API for their frameworks. The number of libraries that provide a nice little DSL grows constantly. The session introduces you to some of those libraries and explains, how Kotlin makes creating the DSL so simple. Lambdas, extension methods, lambdaswith the receiver, and other syntactic sugar make it easy to implement DSL in Kotlin. In a live coding demo, we will create a simple DSL for the existing Java classes that could be used from a Kotlin code.