4 ms·
> Playing with the syntax of a language forces you to have to maintain it yourself and creates a burden on anyone else who has to read your code. You're doing
by sklogic 11y ago
> Playing with the syntax of a language forces you to have to maintain it yourself and creates a burden on anyone else who has to read your code.
You're doing it wrong. eDSLs are designed to simplify the code and make it easier to read it and maintain it. If it is not your case, then you did not design your eDSLs properly.
> Our minds can only handle so much abstraction at once,
Our minds can operate with a very limited set of entities at once. Abstractions are absolutely essential for reducing complexity. Of course you must stay on a same level of abstraction, and you cannot really do it without metaprogramming. You can design a nice, clean DSL which only deals with the problem domain level of abstraction, does not expose anything irrelevant from your host language.
Without this all your abstractions are leaky, and you'll see the host language peculiarities through your problem domain, making it harder to grasp all at once.
- vinceguidry 11y agoA DSL is something you have to design and maintain. The simplifications do not come free. Things leak through DSLs all the time, it's not a magic bullet. I've made and ripped out a bunch of DSLs, now it's a tool I only reach for if there's a clear need for it.
- sklogic 11y agoDesigning DSLs is cheap and easy if you have a proper metaprogramming. It is as simple as picking up a number of language features from your toolbox and mixing them together in a simple, declarative way. Maintaining DSLs is also much, much easier than maintaining essentially the same thing, but mutilated and spread in thousands lines of application code, mixed with a number of lower and higher levels of abstraction. > now it's a tool I only reach for if there's a clear need for it. There is almost always a need for a DSL. Pretty much any problem is better solved with a DSL, as long as it's something more complex than a "Hello, world".