2 ms·
This is why it's always important to consider semantics when you define an abstraction—whether it's a DSL or a normal library. Life is a lot easier when your se
by tikhonj 10y ago
This is why it's always important to consider semantics when you define an abstraction—whether it's a DSL or a normal library. Life is a lot easier when your semantics are simple, precise and composable (the semantics of an expression are clearly derived from the semantics of its components).
It makes the up-front design more difficult—you can't just muddle through a design without thinking deeply about it—but pays off in the long run.
If you have nice semantics, I think the advantages of building a DSL (mostly greater expressiveness and flexibility) vastly outweigh any confusion people might have about the different syntax. If the semantics are genuinely simple, learning how the syntax maps to then should not be difficult.
And with unclear semantics, even a non-DSL library is going to be hard to use and understand.