caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0
@ 2017-01-01 15:20 Oleg
  2017-01-01 16:03 ` Gabriel Scherer
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Oleg @ 2017-01-01 15:20 UTC (permalink / raw)
  To: caml-list


BER MetaOCaml N104 is a strict superset of OCaml 4.04.0 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 N104 comes with one minor and two notable improvements.
The minor improvement is the availability of the native MetaOCaml.  If
the generator is compiled in native mode (using metaocamlopt), the
dynamically generated and run code will be natively-compiled as
well. The lack of native mode was the most frequently heard criticism
of MetaOCaml, although in my experience it hardly even
matters. Off-line code specialization seems to be far more prevalent
and useful than online one. Anyway, here we have it.

The notable new features -- not seen in MetaOCaml (or MetaML, for that
matter) -- are generating pattern-matching expression with the
statically unknown number of clauses, and let-insertion as a
primitive. To wit, |genlet exp| inserts  |let freshname = exp in ...| 
somewhere in the generated code and returns |.<freshname>.| (unless |exp|
is already syntactically a value such as a variable reference).
The let-statement is inserted at the most appropriate place.

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

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


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

end of thread, other threads:[~2017-01-20  3:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-01 15:20 [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0 Oleg
2017-01-01 16:03 ` Gabriel Scherer
2017-01-01 19:25   ` Manfred Lotz
2017-01-01 19:34     ` Gabriel Scherer
2017-01-01 20:06       ` Manfred Lotz
2017-01-15  8:55   ` Oleg
2017-01-14 12:10 ` Eray Ozkural
2017-01-16 13:18 ` Eray Ozkural
2017-01-16 13:25   ` Gabriel Scherer
2017-01-16 17:12     ` Eray Ozkural
2017-01-18 21:20   ` Oleg
2017-01-20  3:13     ` Eray Ozkural

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).