DSL - domain specific language. Let's start what is domain - domain is some defined area, scope. This domain can be web site look, and you have for it CSS and second domain can be web site structure, and here you have HTML.
But, domain can be also Company X Application. And in scope of this domain some language can be created. Language does not mean - fully flavored thing with own gramma, syntax, compilator or runtime. DSL can be just a list of tools which solve domain problems.
Lets consider OOP and its model to represent domain objects by classes and methods as those objects behaviors. If we create such structure, and give these objects behaviors, then we can write a code using those concepts. Consider this pseudo code example:
cookie = async getCookie(cookieId)
user = async getUser(userId)
result async user.buy(cookie)
if (result.isError()) {
error.showAlert("User has not enough money")
} else {
confirmation.showSuccess("Cookie was bought")
}
How much from above is GPL (general purpose language) and how much is specific domain terminology and tools. This is a mix of two, but all commands are here domain specific. That said we can say that above is written in DSL where the domain is some application x.
Going forward with this example I can create even more abstract tools, and mostly perform the control flow by those tools, consider (this is more FP, but hope you get what I mean):
waitForMany(getCookie(cookieId), getUser(userId)
.andThen([cookie, user] -> user.buy(cookie))
.andThen(showSuccess("Cookie was bought"))
.whenError(showError("User has not enough money"))
As you can see I was able to abstract quite a lot and use this abstraction to perform the control flow. And everything is based on GPL and works in scope of GPL.
To reveal the truth, we all write DSL, every domain specific abstraction which u can use is kind that. But most of those abstraction are not complete solutions, that is why we tent not to use this word too often. But if you have set of tools, functions which abstract your domain, they form kinda DSL.
What is also DSL, many things, for example any framework which provides set of rules is DSL. If you see somebody is claiming he is React developer, then you know he is Domain Specific Developer, as React is exactly DSL which is alternative for using native web platform. If you can compose functionality from existing domain specific tools then you are writing using DSL. Going deeper in React, sorry all folks not from this DSL :D, you can create set of components, and compose them as building blocks, and hurra!, now you made DSL on top of DSL.
Yep repeated DSL too many times here, sorry.