Fun DSLs in Kotlin - Builders and Receiver Types

We use DSLs everywhere. Every language has different patterns, so today I wanted to share a fun Kotlin pattern that you can use for builders in your embedded DSL. A Convoluted Example Let’s say that we are building a scraper today to help us scrape all the passwords off an unprotected admin page in a website. The admins have access to a lot of JSON endpoints that look something like:...

December 22, 2021 · 6 min · João N. Matos