5 ms·
> The only alternative is to implement an ad hoc interpreter. You could also have your eDSL calls act as data constructors for an AST and then implement an `ev
by eutectic 11y ago
> The only alternative is to implement an ad hoc interpreter.
You could also have your eDSL calls act as data constructors for an AST and then implement an `eval` function which invokes a run-time compiler.
- sklogic 11y agoThis is not any different from a macro. You still translate your DSL into your host language AST, with the only final step different - runtime eval instead of a compile-time macro. All my macros look like (defmacro something (dsl) (compile-dsl-whatever dsl)). You can always pass the same (compile-dsl-whatever dsl) to (eval ...).