2 ms·
Having an API that matches a natural language is not a DSL per se, either internal or external. It may help creating an internal DSL though. An external DSL is
by ragebol 11y ago
Having an API that matches a natural language is not a DSL per se, either internal or external. It may help creating an internal DSL though.
An external DSL is parsed and compiled or interpreted into or by another general programming language, usually.
An internal DSL, the way I see it, is a 'language' that uses the language it is embedded in in such a way that it makes it easy to read and understand by those initiated with the DSL (ie. the domain experts). And may not look all that much like the embedding language.
The benefit of a DSL can be that you can do verification etc on the semantics of the domain. An API with handy naming may not be able to do this trick.
Note that the readers and writers of a DSL may be very different audiences: the readers can be domain experts who give feedback while the writers may be software engineers.