|
|
|
|
|
by sklogic
3693 days ago
|
|
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. |
|