What is a Domain Specific Language (DSL)?
Tags: programming, dsl, beginners, opensource
Published: 2023-07-28 21:50:50

## Some History

back in November 2004, Sergey Demitriev, the CEO of Jetbrains, published published an articled titled “language oriented paradigm: the next programing paradigm” from which started this new wave of thoughts about the concept of creating a domain “field” specific language that gives a higher level of abstraction that can be more optimized for this specific type of field, a language that takes the concepts of a field and turn them into reproducible, easy to understand and custom syntax.

## Why do DSLs exist ?

all right, let me tell you a small story about two friends of mine, let’s call them Ebs and Kemo, Ebs is an analog electronics engineer who is a very talented engineer, while Kemo is our trusted Software Engineer who is the Lead Software engineer of the group, and pretty much our tech guru,
so one day Ebs wants to simulate an electronic circuit but he doesn’t have the required programming skills to do so, so he goes to Kemo and asks him to write the simulation program for him and so does Kemo but he missed up some edge cases of the circuit and so the simulation produced false results and iterates a lot on the code-base with Ebs till they reach a satisfying result. 
at this point Kemo thinks to him self and says why don’t I with the help of Ebs write a software that eases the use of programming for Ebs to write as many simulations and produce the required results using it, at this point DSL comes to the rescue.

if you have a method that can convey the domain specifics easily in a language that is kinda aligned with this specific field, this makes the thought process more clear, because your code hides implementation specifics inside separating the essentials from the complex clutter.

## Where can we find DSLs?

DSLs are found in the wild a lot, android studio for an instance uses a DSL for Building and testing android applications using the build system named “Gradle”, as an junior android developer doesn’t have to be concerned with how the application build process is done, he just puts instructions to get some library or to apply some plugins and voi la, the process works like a charm.

also there is Groovey with it’s Closures that helps building a DSL engine and resolve it using JVM magic.

## Where can we start ?

you can check this guide here by the one and only Martin Fowler 

[DSL Guide](https://martinfowler.com/dsl.html)

also don’t forget to check this great video on how to build a DSL Engine in Groovey by [Szymon Stepniak](https://www.youtube.com/@szymonstepniak) 

[You Wouldn't Believe How Simple Writing Groovy DSL Is 🤯 Let's Do It In 20 Minutes 🕓](https://www.youtube.com/watch?v=i9pNYW1Pg9A)

and check this article from 2004 that I mentioned earlier 

[language oriented paradigm: the next programing paradigm](https://resources.jetbrains.com/storage/products/mps/docs/Language_Oriented_Programming.pdf?_gl=1*11tisfl*_ga*ODgzODg3NjA5LjE2ODk1OTQ0MjI.*_ga_9J976DJZ68*MTY5MDU3ODI2Ni4yLjAuMTY5MDU3ODI3MC4wLjAuMA)


Photo by <a href="https://unsplash.com/@axpphotography?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">AXP Photography</a> on <a href="https://unsplash.com/photos/6W__AamA65E?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>