* [Caml-list] ANN: (BER) MetaOCaml N153, for OCaml 5.3.0
@ 2025-05-06 6:49 Oleg
2025-05-07 7:16 ` Jeremy Yallop
0 siblings, 1 reply; 2+ messages in thread
From: Oleg @ 2025-05-06 6:49 UTC (permalink / raw)
To: caml-list
BER MetaOCaml (or, simply MetaOCaml, since there aren't any others)
N153 is a strict superset of OCaml 5.3.0 for ``writing programs that
generate programs''. 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. MetaOCaml also
features cross-stage persistence, generating ordinary and
mutually-recursive definitions, first-class pattern-matching and
heterogeneous metaprogramming.
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 subset of the generated OCaml code can
also be converted to C, via offshoring. (The generated C needs no
particular runtime or GC.) A well-typed MetaOCaml program
generates only well-scoped and well-typed programs: The generated code
shall compile without type errors. Staging-annotation--free
MetaOCaml is identical to OCaml; MetaOCaml can link to any
OCaml-compiled library (and vice versa).
There aren't any notable new features to talk about. OCaml 5.x has
changed AST (Parsetree) and Typedtree in significant ways, especially
concerning functions. Adjusting MetaOCaml to those changes took some
work. See also ChangeLog and NOTES.txt in the MetaOCaml distribution
for more details.
I'm very thankful to the OCaml team for merging the patch to the OCaml
grammar concerning staging annotations. It has made maintaining
MetaOCaml quite easier.
MetaOCaml N153 should be available through OPAM, hopefully soon.
In the meanwhile, it is available as a set of patches to the
OCaml 5.3.0 distribution.
https://okmij.org/ftp/ML/ber-metaocaml.tar.gz
See the INSTALL document in that archive. You need the source
distribution of OCaml 5.3.0.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-07 7:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-06 6:49 [Caml-list] ANN: (BER) MetaOCaml N153, for OCaml 5.3.0 Oleg
2025-05-07 7:16 ` Jeremy Yallop
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox