caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oleg <oleg@okmij.org>
To: caml-list@inria.fr
Subject: [Caml-list] ANN: BER MetaOCaml N107, for OCaml 4.07.1
Date: Sun, 7 Oct 2018 00:19:30 +0900	[thread overview]
Message-ID: <20181006151930.GA15255@Melchior.localnet> (raw)


BER MetaOCaml N107 is a strict superset of OCaml 4.07.1 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. 
Staging-annotation-free BER MetaOCaml is identical to
OCaml; BER MetaOCaml can link to any OCaml-compiled library (and
vice versa); findlib and other tools can be used with BER MetaOCaml as
they are, in their binary form.

BER MetaOCaml N107 is a superset of the just released OCaml 4.07.1.
It also has a number of small improvements: better error messages, no
longer needing parentheses when putting a sequence of statements in
brackets, more convenient genlet, etc.  It also has two notable
additions: explicit lifting and new offshoring.

Explicit lifting is the explicit conversion of a value to the code,
which, when compiled and run, (re-)produces that value.  BER N107 supports
explicit lifting of base-type values and lists, options, and, notably,
arrays of liftable values. Explicit lifting is described in Section
3.2.1 of the MetaOCaml book.

The generated code, if simple enough, can be `offshored' -- converted
to the intermediate, imperative language which may then be transcribed
to C, OpenCL, LLVM, etc. When generating computational kernels, the
code is supposed to be simple enough, so it runs fast. One test case
in MetaOCaml distribution shows how can one go about converting the
intermediate code to C. Offshoring thus lets us treat a subset of
OCaml as a new notation (syntax) for C.


BER MetaOCaml N107 should be available though OPAM, hopefully soon.
In the meanwhile, it is available as a set of patches to the 
OCaml 4.07.1 distribution. 
        http://okmij.org/ftp/ML/ber-metaocaml-107.tar.gz
See the INSTALL document in that archive. You need the source
distribution of OCaml 4.07.1.

For more explanations, please see
        http://okmij.org/ftp/ML/MetaOCaml.html
as well as ChangeLog and NOTES.txt in the BER MetaOCaml distribution.

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

                 reply	other threads:[~2018-10-06 15:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20181006151930.GA15255@Melchior.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;
as well as URLs for NNTP newsgroup(s).