Friday, June 1, 2018

Kotlin DSLs: The Basics

A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There is a wide variety of DSLs, ranging from widely used languages for common domains, such as HTML for web pages, down to languages used by only one or a few pieces of software.

Kotlin DSL

Kotlin provides first-class support for DSLs, which allows us to express domain-specific operations much more concisely than an equivalent piece of code in a general-purpose language.

Let’s try and build a simple DSL in Kotlin:



from DZone.com Feed https://ift.tt/2swZwpg

No comments:

Post a Comment