# domain-specific language

Published articles for domain-specific language.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How Gradle Works Part 3 - Build Script

DevFeed: [How Gradle Works Part 3 - Build Script](<https://devfeed.tech/articles/how-gradle-works-part-3-build-script-24644.md>)

Original publisher: [Read original article](<https://blog.gradle.org/how-gradle-works-3>)

Author: Bo Zhang

Published: 2023-03-10T02:00:00Z

Content type: article

Language: en

Sources: [The Gradle Blog](<https://devfeed.tech/sources/the-gradle-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Groovy](<https://devfeed.tech/topics/groovy.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [domain-specific-language](<https://devfeed.tech/tags/domain-specific-language.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [groovy](<https://devfeed.tech/tags/groovy.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [script](<https://devfeed.tech/tags/script.md>)

### AI overview

The third article in the How Gradle Works series explains what happens during Gradle build script execution. It describes the Kotlin and Groovy DSLs, including lambda and closure syntax, omitted parentheses, trailing function arguments, chained method invocation, and receiver or delegate objects mapped to Gradle API methods.

### Source excerpt

Previously on How Gradle Works: How Gradle Part 1 - Startup How Gradle Part 2 - Inside The Daemon This is the third blog of the series How Gradle Works. In this blog we'll explain what happens during build script execution. Kotlin & Groovy DSL If you are a Java developer, when you open any Gradle build script (for example build.gradle.kts or build.gradle), the first thing that might confuse you is the special syntax of curly braces: // Kotlin DSL: plugins { id("some.plugin") version "0.0.1" } // or Groovy DSL: plugins { id "some.plugin" version "0.0.1" } What's this? What happens when Gradle executes these kinds of scripts? The short answer is: they are DSLs (Domain Specific Language) on top of the Kotlin programming language for .gradle.kts files, or on top of the Groovy programming language for .gradle files. These DSLs have some implicit rules, making them appear very confusing. Implicit Rule 1: Lambda/Closure First of all, { ... } is a special object in both Groovy and Kotlin. This object is called a lambda in Kotlin, or a closure in Groovy. They're similar to function objects in other programming language, like Java's lambda, or JavaScript's function object. You can think of plugins { ... } as a method invocation in which a Kotlin lambda object or Groovy closure object is passed as the argument, because both Groovy and Kotlin allow you to omit parentheses: plugins(function() { ... }) Also, there is one noteworthy DSL: in Kotlin/Groovy, if the last parameter of a function is a lambda/closure, it's allowed to be put outside of parentheses. For example, the following code snippet: tasks.register("myTask") { ... doLast { ... } } is equivalent to: tasks.register("myTask", function() { ... doLast(function() { ... }) }) The code inside the function may be executed immediately or later, depending on the implementation of the specific method. Implicit Rule 2: Chained Method Invocation In the plugins { } example above, the Kotlin version: id("some.plugin") version "0.0.1

## Error Handling in Kotlin with Arrow and Either

DevFeed: [Error Handling in Kotlin with Arrow and Either](<https://devfeed.tech/articles/a-birds-eye-view-of-arrow-error-handling-39300.md>)

Original publisher: [Read original article](<https://kt.academy/article/fk-arrow-error-handling>)

Published: 2022-12-06T00:15:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [function](<https://devfeed.tech/topics/function.md>), [domain-specific language](<https://devfeed.tech/topics/domain-specific-language.md>)

Tags: [domain-specific-language](<https://devfeed.tech/tags/domain-specific-language.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception](<https://devfeed.tech/tags/exception.md>), [functions](<https://devfeed.tech/tags/functions.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how functional Kotlin code can represent errors in return types instead of exceptions. It compares nullable values with explicit error handling and introduces Arrow DSLs based on continuations to provide a unified API for different error types.

### Source excerpt

Learn about Error Handling in Arrow, end how to effectively work with Either.

## DSL type-safe builders

DevFeed: [DSL type-safe builders](<https://devfeed.tech/articles/dsl-type-safe-builders-39303.md>)

Original publisher: [Read original article](<https://kt.academy/article/fk-dsl>)

Published: 2022-09-09T00:04:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [domain-specific language](<https://devfeed.tech/topics/domain-specific-language.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [React](<https://devfeed.tech/topics/react.md>), [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [JavaFX](<https://devfeed.tech/topics/javafx.md>)

Tags: [domain-specific-language](<https://devfeed.tech/tags/domain-specific-language.md>), [domain-specific-languages](<https://devfeed.tech/tags/domain-specific-languages.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [groovy](<https://devfeed.tech/tags/groovy.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [type](<https://devfeed.tech/tags/type.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A tutorial on type-safe DSL builders in Kotlin. It explains how Gradle configurations moved from Groovy toward Kotlin DSLs, covering static typing, editor suggestions, typo detection, helper functions, classes, and lambda expressions. It also discusses DSL use in React, backend HTML, SwiftUI, Jetpack Compose, and desktop applications.

### Source excerpt

How to define type-safe DSL builders in Kotlin.

## Writing First-Class Features: BDD and Gherkin.

DevFeed: [Writing First-Class Features: BDD and Gherkin.](<https://devfeed.tech/articles/writing-first-class-features-bdd-and-gherkin-34670.md>)

Original publisher: [Read original article](<http://fernandocejas.com/blog/engineering/2021-01-23-writing-first-class-features-bdd-gherkin/>)

Author: Fernando Cejas (me@fernandocejas.com)

Published: 2021-01-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Fernando Cejas Blog](<https://devfeed.tech/sources/fernando-cejas-blog.md>)

Topics: [Behavior-driven development](<https://devfeed.tech/topics/bdd.md>), [domain-specific language](<https://devfeed.tech/topics/domain-specific-language.md>), [Development](<https://devfeed.tech/topics/development.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [bdd](<https://devfeed.tech/tags/bdd.md>), [communication](<https://devfeed.tech/tags/communication.md>), [culture](<https://devfeed.tech/tags/culture.md>), [development](<https://devfeed.tech/tags/development.md>), [domain-specific-language](<https://devfeed.tech/tags/domain-specific-language.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [feature](<https://devfeed.tech/tags/feature.md>), [framework](<https://devfeed.tech/tags/framework.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [ios](<https://devfeed.tech/tags/ios.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [linux](<https://devfeed.tech/tags/linux.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [organization](<https://devfeed.tech/tags/organization.md>), [processes](<https://devfeed.tech/tags/processes.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [rust](<https://devfeed.tech/tags/rust.md>), [scala](<https://devfeed.tech/tags/scala.md>), [software](<https://devfeed.tech/tags/software.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [web-development](<https://devfeed.tech/tags/web-development.md>), [writing](<https://devfeed.tech/tags/writing.md>)

### AI overview

The article explains how behavior-driven development (BDD) and the Gherkin domain-specific language can establish a shared vocabulary for writing software features. It presents BDD as a collaborative process involving developers, QA, and business participants, and describes how structured natural-language scenarios can express behavior and acceptance criteria.

### Source excerpt

As our product evolves, **there is the need to adopt a common vocabulary**, interpreted by all the moving parts of our organization: business users, analysts, managers, engineers, etc. **A technique like BDD and the Gherkin language can help us to achieve this goal**.

## Making OpenAPI / Swagger Bearable With Your Own DSL

DevFeed: [Making OpenAPI / Swagger Bearable With Your Own DSL](<https://devfeed.tech/articles/making-openapi-swagger-bearable-with-your-own-dsl-15757.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/making-openapi-swagger-bearable-with-your-own-dsl>)

Author: Sebastien Armand

Published: 2019-08-02T19:00:00Z

Content type: tutorial

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [Racket](<https://devfeed.tech/topics/racket.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [domain-specific-language](<https://devfeed.tech/tags/domain-specific-language.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [json](<https://devfeed.tech/tags/json.md>), [openapi](<https://devfeed.tech/tags/openapi.md>), [swagger](<https://devfeed.tech/tags/swagger.md>), [yaml](<https://devfeed.tech/tags/yaml.md>)

### AI overview

The article explains how to use Racket to create a domain-specific language for defining OpenAPI documents. It addresses the verbosity, limited composability, and multi-file maintenance problems of handwritten OpenAPI, describing a DSL that produces YAML or JSON and reduced specification files from about 1,000 lines to about 100.

### Source excerpt

Taming OpenAPI using Racket to create a DSL