caml-list - the Caml user's mailing list
 help / Atom feed
* [Caml-list] ANN: BER MetaOCaml N107, for OCaml 4.07.1
@ 2018-10-06 15:19 Oleg
  0 siblings, 0 replies; 1+ messages in thread
From: Oleg @ 2018-10-06 15:19 UTC (permalink / raw)
  To: caml-list


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

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-06 15:19 [Caml-list] ANN: BER MetaOCaml N107, for OCaml 4.07.1 Oleg

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox