3 ms·
Actually, this is one of the most important, albeit usually implicit, features of a good programming language: how easy it makes to create a DSL (without leavin
by Koshkin 10y ago
Actually, this is one of the most important, albeit usually implicit, features of a good programming language: how easy it makes to create a DSL (without leaving it). This is because ideally you would first find or create a language to express, in the most adequate way, the problem you are trying to solve, and only then you solve it. That is why pseudo-code is useful. The OO support in programming languages made creating a DSL somewhat easier, but it is true - nothing can compare with Lisp in this regard. (So, I guess, this makes Lisp the best programming language of all time.)
- dozzie 10y ago> how easy it makes to create a DSL (without leaving it). Pretty much impossible. If you don't leave your original language, you don't use domain specific language, you just have general purpose language with domain specific API.
- TeMPOraL 10y agoYou're missing the point. Some programming languages (Lisp family in particular) allow you to build DSLs directly, with the tools the language itself provides.
- dozzie 10y agoAnd then, inside this "DSL" in Lisp, can you have a completely different language, with significant spaces and unmatched parentheses? Or is it just Lisp data structures that are then interpreted and you're pretending to use language other than Lisp because of its flexible data structures notation?
- Koshkin 10y agoBut what is an API? Is it just a set of functions? Even then, it is already a language, with its own vocabulary. Or, is it a set of classes, interfaces, etc.? Then, even more so. And so on. Limitations and particulars of the syntax of a host language do not matter as much as you may think. Also, if you look close enough, you will realize that most of the languages already are, in fact, combinations of various built-in sublanguages, each having its own "subsyntax". What matters is the ease with which the host allows to create a new sublanguage that suits a particular purpose.