TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Simplified BER MetaOCaml N102, for OCaml 4.02.1

10 pointsby a0over 10 years ago

1 comment

saidajigumiover 10 years ago
For anyone else who wasn&#x27;t previously familiar with MetaOCaml, [1] provides an overview and relevant details of this implementation. E.g.:<p><i>BER MetaOCaml is a conservative extension of OCaml for ``writing programs that generate programs&#x27;&#x27;. BER MetaOCaml adds to OCaml the type of code values (denoting ``program code&#x27;&#x27;, 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.</i><p>The bit about generating only well-scoped, well-typed programs is pretty interesting!<p>[1] <a href="http://okmij.org/ftp/ML/MetaOCaml.html" rel="nofollow">http:&#x2F;&#x2F;okmij.org&#x2F;ftp&#x2F;ML&#x2F;MetaOCaml.html</a>