News for hackers. Stuff that matters.
Re:Roll your own minilanguages with mini-interpreters (1989) by valenterry on Tuesday July 06, 2021 @07:27PM (#27755631)
> But there is any easier way. In Haskell just use a typeclass

I understand your point. In fact, I mostly do what you say, because it is simple and usually sufficient in most cases.

But it is important to understand that there is a difference. A minilanguage or an embedded DSL with free monads allows for custom transformations and it completely separates the interpretation from the description of the domain logic/actions.

With the approach(es) that you mention, that is not the case. You both describe and directly execute/interprete the logic in an intermingled way. That can be an advantage because it makes things easier (less abstraction) and more direct, but it can be a disadvantage if you have the need to interpret in different ways and have full separation between these two phases.

There are no comments on this comment yet.