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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E78EB7FA1F for ; Fri, 11 Jul 2014 15:32:01 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of benjamin.canou@gmail.com) identity=pra; client-ip=74.125.82.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="benjamin.canou@gmail.com"; x-sender="benjamin.canou@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of benjamin.canou@gmail.com designates 74.125.82.175 as permitted sender) identity=mailfrom; client-ip=74.125.82.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="benjamin.canou@gmail.com"; x-sender="benjamin.canou@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f175.google.com) identity=helo; client-ip=74.125.82.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="benjamin.canou@gmail.com"; x-sender="postmaster@mail-we0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvIAACPnv1NKfVKvm2dsb2JhbABZgmp2g0u9fohRFg8BAQEBAQYLCwkUKIQcEQ8BBQgBGxwCAxIQDwIFFgsCCwMCAQIBEREBBQEvCAIeiAsBAxEBBAieEIMSaosngXKDEIwUChknDWSGNBEBAQQOgR6MC4IsgmGBTAWbBZIqQYR2 X-IPAS-Result: AvIAACPnv1NKfVKvm2dsb2JhbABZgmp2g0u9fohRFg8BAQEBAQYLCwkUKIQcEQ8BBQgBGxwCAxIQDwIFFgsCCwMCAQIBEREBBQEvCAIeiAsBAxEBBAieEIMSaosngXKDEIwUChknDWSGNBEBAQQOgR6MC4IsgmGBTAWbBZIqQYR2 X-IronPort-AV: E=Sophos;i="5.01,643,1400018400"; d="scan'208";a="84796931" Received: from mail-we0-f175.google.com ([74.125.82.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 11 Jul 2014 15:31:46 +0200 Received: by mail-we0-f175.google.com with SMTP id k48so1080757wev.20 for ; Fri, 11 Jul 2014 06:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=6ZOeTSG8JwTK6g2iP1Hdf9JucizuTcwWrylA45Q7uqA=; b=W896nm62PHyujqqtd1c0CzALKyct6mhaQcjPnXlzotCp2h0ODfxjFPtQLcXjp1XHmb L7LCwoOolRGp16xi+/XoTgvY0wsxv4iV90YzoN4P+couDRWWvi4IgKpcs7wIRMDjvCTy d9MJ6iH0027nw31zLn02S0mh0SvrzxlO1jsQfHuVyhPWuL6XhUapEbnm2ijeaYZmdwfb VjCY18bPH4GgibNqF8cRAQQI/2FGAilETeDLVazvBuOOtxbT3feC2FM2oNjGwSgaoEml Nu03RHhwehnRRDmA3Hjdez7TZUSg+tXFs3vI4wbp+Kd8clBpXsYkt0sRVSk83HE2pZCb xEGg== X-Received: by 10.194.90.51 with SMTP id bt19mr36454987wjb.105.1405085505246; Fri, 11 Jul 2014 06:31:45 -0700 (PDT) Received: from ?IPv6:2001:660:3013:3:9eb6:54ff:fea5:8a99? ([2001:660:3013:3:9eb6:54ff:fea5:8a99]) by mx.google.com with ESMTPSA id rw4sm5202369wjb.44.2014.07.11.06.31.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jul 2014 06:31:44 -0700 (PDT) Message-ID: <53BFE73E.6060106@gmail.com> Date: Fri, 11 Jul 2014 15:31:42 +0200 From: Benjamin Canou User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Icedove/30.0 MIME-Version: 1.0 To: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: [Caml-list] proposal for finding, loading and composing ppx preprocessors Dear OCaml'ers, To accompany the arrival of annotations in the forthcoming release, we propose to discuss and hopefully agree on a standard way of selecting the adequate preprocessor(s) for a given file. Gerd already introduced a mechanism in the last version of OCamlFind, that we'd like to extend as follows. Our idea is to indicate via a pragma inside the file, how it has to be processed. You can see that as a machine readable way of writing (* this file has to be preprocessed with blah using options blah *). For this, we propose that build systems use a default preprocessor systematically, that would interpret these pragmas and find and call its fellow preprocessors accordingly. The compiler already provides built-in annotations. In a way, it's a second predefined layer, this time for the build system. We designed and prototyped such a tool [1], which understand annotations of the form [@@@ syntax "package"], to preprocess the following code using the ppx declared in the corresponding OCamlFind package. The tool also defines a way to register plug-ins instead of executables so preprocessors can be dynlinked instead of called as processes. Extensions could be: - delimiting a fragment of the code to process - add a way to associate a given annotation identifier to a preprocessor, so that only the mother preprocessor would do the tree traversal, specific preprocessors only seeing the nodes they are actually interested in. - other kind of pragmas for the build system ? Again, the goal is to agree now on a standard way and avoid the mess we had with camlp4. What do you think ? Benjamin, Grégoire and Pierre @ OCamlPro. [1] https://github.com/hnrgrgr/ppx_loader