In addition to having the usual constructs
of a general-purpose language, multi-stage languages internalize
the notions of runtime program generation and execution. Thus, multi-stage
languages provide the programmer with the essence of partial evaluation
and program specialization techniques, both of which have been shown
to lead to dramatic resource-utilization gains in a wide range of applications,
starting from implementations of domain-specific compilers, to high-performance
operating systems. Multi-stage languages make it possible to write generic
and highly-parameterized programs that do not pay unnecessary runtime overheads.
MetaOCaml is a multi-stage extension
of the OCaml programming language,
and provides three basic constructs called Brackets, Escape, and Run for
building, combining, and executing future-stage computations, respectively.
(Please read README-META file in distribution for MetaOCaml's syntax for
these constructs). MetaOCaml is a compiled dialect of MetaML