TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Simplified BER MetaOCaml N102, for OCaml 4.02.1

10 点作者 a0超过 10 年前

1 comment

saidajigumi超过 10 年前
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>