News for hackers. Stuff that matters.
Re:The Beauty of Clojure by eutectic on Wednesday August 26, 2015 @06:55AM (#10122127)
> 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.

Re:The Beauty of Clojure by sklogic on Wednesday August 26, 2015 @08:43AM (#10122485)
This 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 ...).