Functional languages have proven substantially useful for hosting embedded domain-specific languages. They provide an infrastructure
rich enough to define both a convenient syntax for the embedded language, a type system for embedded programs, and an evaluation
mechanism for embedded programs. However, all existing host languages either interpret embedded programs instead of compiling
them or require an expensive pre-compilation phase. In this article we close this gap in an implementation of the functional
language OCaml: We provide a library of OCamlb yte-code combinators that is reminiscent of quasi-quotation in Lisp and of
’C and that enables just-in-time compilation of embedded programs. We illustrate these byte-code combinators on a prototypical
domain-specific language.
Keywords Just-in-time compilation - OCaml - domain-specific language - embedded language
Funded by the Danish National Research Foundation.