

Simplified BER MetaOCaml N102, for OCaml 4.02.1 - a0
https://groups.google.com/forum/#!topic/fa.caml/x4P5sWWrn5Q

======
saidajigumi
For anyone else who wasn't previously familiar with MetaOCaml, [1] provides an
overview and relevant details of this implementation. E.g.:

 _BER MetaOCaml is a conservative extension of OCaml for ``writing programs
that generate programs ''. BER MetaOCaml adds to OCaml the type of code values
(denoting ``program code'', or future-stage computations), and two basic
constructs to build them: quoting and splicing. The generated code can be
printed, stored in a file -- or compiled and linked-back to the running
program, thus implementing run-time code optimization. A well-typed BER
MetaOCaml program generates only well-scoped and well-typed programs: The
generated code shall compile without type errors. The generated code may run
in the future but it is type checked now._

The bit about generating only well-scoped, well-typed programs is pretty
interesting!

[1]
[http://okmij.org/ftp/ML/MetaOCaml.html](http://okmij.org/ftp/ML/MetaOCaml.html)

