Compiling Embedded Programs to Byte Code

  • Authors:
  • Morten Rhiger

  • Affiliations:
  • -

  • Venue:
  • PADL '02 Proceedings of the 4th International Symposium on Practical Aspects of Declarative Languages
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.