7 ms·
Your Python DSL looks very nice. There's no reason a Haskell one couldn't look equally nice.
by tome 14y ago
Your Python DSL looks very nice. There's no reason a Haskell one couldn't look equally nice.
- dons 14y agoIndeed, with type information you can do quite sophisticated embedded DSLs that heavily reuse the host language's infrastructure for variables, control and types. So no need for the LpVariable stuff, for example, and you get type safety. An example of an SMT solver DSL, which: * reuses Haskell's type checker to check the types of the embedded language, * uses Haskell's polymorphism to add polymorphism to the underlying language * and the host language's variables as target language variables. http://code.haskell.org/~dons/docs/yices-painless/Yices-Painless-Language.html http://code.haskell.org/~dons/docs/yices-painless/Yices-Pain...