Skip to content

Comment on Simplified BER MetaOCaml N102, for OCaml 4.02.1

Comments

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.