Hacker News new | ask | show | jobs
by sklogic 3693 days ago
Monadic interpreters? Composable? Are you kidding? It is a joke, not a composability. You cannot take a type system of one DSL, modules from another and only the expressions syntax from a third one and then mix them all together into a new DSL.

And, anyway, interpreters. Who in a sane mind can ever consider an interpreter?

Also, you obviously do not realise that macro-based DSLs are by far more debuggable than any monadic interpreter would ever be.

1 comments

Before we continue, post a link to a free monad DSL you have written; I do not intend to waste my time in a discussion with a zealot.

(I can send you examples of macros I've had to write, if you desire.)

@sklogic (can't reply directly): I know how to use macros, I've used them and I have come to the conclusion that there are much better tools.

Seeing you know what a logical phallacy is, here is one more for you: "if you don't like macros you don't know how to use them". Can you guess the name?

My question was not ad hominem. I wanted to see whether you have actually used the thing you are arguing against or instead just blindly praising something as the ultimate solution and thereby determine whether I should continue this discussion with you.

Why would you be interested in my pitiful attempts if even the best examples of the monadic DSLs people keep pointing too are all thoroughly horrible, convoluted and unmaintainable? Likewise, why should I look at your macros if you already admitted that you do not know how to use them?

Can you comment constructively about the composability issue without resorting to ad hominem?

Do you even understand the idea if the macro-based DSL design methodology?

I guess you can have something as horrible as the CL LOOP macro in mind, instead of any properly designed DSLs.

Drop me a mail, p<dot>kamenarsky, gmail.com.
(cannot answer there too, weird...)

No, I conculded that you have no idea how to implement macro-based DSLs from your remarks about composability and debugging. You cannot be so out of touch and still know something about the macros.

And, no, you did not point to a viable alternative. Monadic interpreters are complex, convoluted and very inefficient. This is an objective fact, not a matter of a taste.

Do not agree? Show me a definitive example of such a DSL and I will demonstrate how much simpler a macro-based version is.

P.S.: and the free monad part is not what I'm calling convoluted and unmaintainable. It's ok to assemble an AST this way (yet, a custom parser is better). The problem here is in the interpreter part.

Interpreters are inherently bad and there is almost nothing you can do about it. The only sane way of keeping an interpreter complexity under control is to use a single common trivial VM interpreter, write it once, never touch it again, and lower all your monadic DSL ASTs down to it.

Which makes this solution quite similar to the macro-based one (it would actually reek of Greenspun Tenth), but still much less efficient.

I gave you my mail in the other reply, HN is really annoying for longer discusssions.