From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8BEA27F75C for ; Wed, 13 Aug 2014 15:27:44 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jdimino@janestreet.com) identity=pra; client-ip=38.105.200.233; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jdimino@janestreet.com designates 38.105.200.233 as permitted sender) identity=mailfrom; client-ip=38.105.200.233; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout4.mail.janestreet.com) identity=helo; client-ip=38.105.200.233; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="postmaster@mxout4.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0BAPlm61MmacjpnGdsb2JhbABag19XBIJ2yjGHSAGBDAgWEAEBAQEBBhYJPYQEAQEEEhEdAQE3AQ8LBAEGNwICIhIBBQEcBhsaiCADCqRmaooyd4UCAQWQLRECBAqPPgQHgnmBU5VIhnaHJ4tlGCmFDms X-IPAS-Result: Aq0BAPlm61MmacjpnGdsb2JhbABag19XBIJ2yjGHSAGBDAgWEAEBAQEBBhYJPYQEAQEEEhEdAQE3AQ8LBAEGNwICIhIBBQEcBhsaiCADCqRmaooyd4UCAQWQLRECBAqPPgQHgnmBU5VIhnaHJ4tlGCmFDms X-IronPort-AV: E=Sophos;i="5.01,857,1400018400"; d="scan'208";a="74713651" Received: from mxout4.mail.janestreet.com ([38.105.200.233]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Aug 2014 15:27:43 +0200 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by mxout4.mail.janestreet.com with esmtps (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1XHYaZ-0008TQ-7l for caml-list@inria.fr; Wed, 13 Aug 2014 09:27:39 -0400 Received: from [172.27.229.230] (helo=mxgoog1.mail.janestreet.com) by tot-smtp with esmtps (UNKNOWN:AES256-GCM-SHA384:256) (Exim 4.72) (envelope-from ) id 1XHYaZ-0007Nw-50 for caml-list@inria.fr; Wed, 13 Aug 2014 09:27:39 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]) by mxgoog1.mail.janestreet.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.72) (envelope-from ) id 1XHYaZ-000225-1R for caml-list@inria.fr; Wed, 13 Aug 2014 09:27:39 -0400 Received: by mail-ig0-f177.google.com with SMTP id hn18so1663946igb.10 for ; Wed, 13 Aug 2014 06:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FK7LD6dyewAsv7vxXfX3Kk+affXJJiz4qN1ksRj9AuU=; b=g2B6vj+NvIgzkotX8Ipgh8luZ6kPN9Y5XlcIFQ+h48Vnw4LCIj0uj66Cxm4kBgHOr2 YBh1J0qiY57BL2gc4nucczL7uTw61jyIgTyILxbBcHdGuiSAwTicdwdRpws34/IVD0xz 0Hn64b1SIiZV/SF1ICo4VkYPu4kgh7rJYfM5w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FK7LD6dyewAsv7vxXfX3Kk+affXJJiz4qN1ksRj9AuU=; b=nBSs5yWqCTFuhpxRDQNfCnWfpMQQ5Jn9tYdRqMTtypjGNocsT68IefVji4dKzc7SWI VZSYlRyLv76X0vQMRyWuoLqV82QDUy59zgGRPhj3HYe+w4JO+3syLZl4d7V0EM09Bk/q MEwq83HOGxEZJbTBiGphFaR56Xx/rrsSBycIe9i6VXTk+9ryITerqc0heg4Ku6OASXrw +AKzwCfM3nx7m0QWaIas+/mjaW1Xuq7eg110ahk4vTcbU7X2n8m0fQvmxDS5CDUnXAaW wTel9eXNc4yYOg6pe0Ivi1D8iB7LMt83KbD6QcfxrFcl4j85mI4PBoYMszVIoDs7pobZ cggA== X-Gm-Message-State: ALoCoQmfwQLZxfqiusa178F4IpppxZt5fpjzePsr0rt1675SEO9kkn+XWfEfiWQmFiv/jtiBP3V7PmAELm2i/fWGN1+oAUgmdn3lQ4gLqhsuRJAoHqfuNBZPJa1CS4890QL7f55+hE4V X-Received: by 10.43.74.134 with SMTP id yw6mr6223181icb.3.1407936458625; Wed, 13 Aug 2014 06:27:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.43.74.134 with SMTP id yw6mr6223162icb.3.1407936458518; Wed, 13 Aug 2014 06:27:38 -0700 (PDT) Received: by 10.50.122.35 with HTTP; Wed, 13 Aug 2014 06:27:38 -0700 (PDT) In-Reply-To: <53EB62EA.6010900@tu-berlin.de> References: <53EB62EA.6010900@tu-berlin.de> Date: Wed, 13 Aug 2014 14:27:38 +0100 Message-ID: From: Jeremie Dimino To: =?UTF-8?Q?Christoph_H=C3=B6ger?= Cc: caml users Content-Type: multipart/alternative; boundary=001a11c39f867a1bd2050082c0b3 Subject: Re: [Caml-list] Best way to generate OCaml code --001a11c39f867a1bd2050082c0b3 Content-Type: text/plain; charset=UTF-8 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 --001a11c39f867a1bd2050082c0b3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 dep= recated and will be distributed as a separate
package starting wi= th OCaml 4.02. You should now use the compiler
libraries which ex= port the same AST used by the compiler [1] as well
as pretty-printers [2]. These are available through the findlib packag= e
compiler-libs.common. To help produce the AST you can use ppx_t= ools [3].


--
Jere= mie
--001a11c39f867a1bd2050082c0b3--