3 ms·
Maybe it's just me, but I feel that in-language DSLs are one of the best ways to write unmaintanable, bug-ridden code. Why? Once it's no longer syntactically
by colanderman 14y ago
Maybe it's just me, but I feel that in-language DSLs are one of the best ways to write unmaintanable, bug-ridden code.
Why? Once it's no longer syntactically clear what's written in the host language and what's written in the DSL, it requires a very thorough understanding of both languages and their interactions to comprehend any given piece of code. And in a language where definitions can be modified at run time or have dynamic scope (it's not clear which of these two methods Elixir uses), it's often hard to tell what is or is not DSL code in the first place.
(Note: I write DSLs for a living. Except, they live apart from any host language, and thus don't allow arbitrary syntactic and semantic mixing and are thus highly amenable to automatic analysis, which is one of, if not the, primary benefit of a DSL.)
- jeremyjh 14y agoYes, this is precisely what I mean when I said "if macros worry you ..." in response to your question about unprincipled meta-programming. If you do not like Ruby-style DSLs then you would not like Elixir's use of macros to achieve similar goals.