caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremie Dimino <jdimino@janestreet.com>
To: "Christoph Höger" <christoph.hoeger@tu-berlin.de>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Best way to generate OCaml code
Date: Wed, 13 Aug 2014 14:27:38 +0100	[thread overview]
Message-ID: <CANhEzE6UbexaeFiLaGX0GNR8shqdx9kbMiE59ZVQLfLcN96QKA@mail.gmail.com> (raw)
In-Reply-To: <53EB62EA.6010900@tu-berlin.de>

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hi Christoph,

what is the state-of-the-art way to generate (programmatically) and
> pretty-print a valid OCaml AST? Should I use camlp4 or is there a
> standalone-library?
>

Camlp4 is being deprecated and will be distributed as a separate
package starting with OCaml 4.02. You should now use the compiler
libraries which export the same AST used by the compiler [1] as well
as pretty-printers [2]. These are available through the findlib package
compiler-libs.common. To help produce the AST you can use ppx_tools [3].

 [1] https://github.com/ocaml/ocaml/blob/trunk/parsing/parsetree.mli
 [2] https://github.com/ocaml/ocaml/blob/trunk/parsing/pprintast.mli
 [3] https://github.com/alainfrisch/ppx_tools

-- 
Jeremie

[-- Attachment #2: Type: text/html, Size: 1379 bytes --]

      reply	other threads:[~2014-08-13 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 13:06 Christoph Höger
2014-08-13 13:27 ` Jeremie Dimino [this message]

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=CANhEzE6UbexaeFiLaGX0GNR8shqdx9kbMiE59ZVQLfLcN96QKA@mail.gmail.com \
    --to=jdimino@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=christoph.hoeger@tu-berlin.de \
    /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).