concept top in category dsl

appears as: top, top
DSLs in Action

This is an excerpt from Manning's book DSLs in Action.

Any external DSL has to be learned separately by the developers. With internal DSLs, all you have to learn is the interface that it publishes on top of the existing host language. But developers are often disturbed to find that not only do they have to learn yet another new language, but it’s one that has limited applicability.

One of the important attributes that an internal DSL adds on top of the underlying language is an enhanced readability of the domain semantics. The internal DSL translates the implementation to the domain user in terms of the language that he understands.

Suppose we have the construct with-tax-fee that introduces additional behaviors within an already existing Clojure function to add tax and fees to our trade. In the following snippet, if we apply with-tax-fee to our trade function, we get a new function that has the additional mappings for :tax and :commission stacked on top of the existing set.