Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Oleg <oleg@okmij.org>
To: caml-list@inria.fr
Subject: [Caml-list] ANN: (BER) MetaOCaml N153, for OCaml 5.3.0
Date: Tue, 6 May 2025 15:49:35 +0900	[thread overview]
Message-ID: <aBmw/+5a2x/aQN5m@Magus.localnet> (raw)


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.


             reply	other threads:[~2025-05-06  6:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06  6:49 Oleg [this message]
2025-05-07  7:16 ` Jeremy Yallop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aBmw/+5a2x/aQN5m@Magus.localnet \
    --to=oleg@okmij.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox