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 BCE187FCCB for ; Thu, 9 Apr 2015 14:24:26 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dario.teixeira@nleyten.com) identity=pra; client-ip=217.70.183.196; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="dario.teixeira@nleyten.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dario.teixeira@nleyten.com) identity=mailfrom; client-ip=217.70.183.196; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="dario.teixeira@nleyten.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@relay4-d.mail.gandi.net) identity=helo; client-ip=217.70.183.196; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="postmaster@relay4-d.mail.gandi.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CgAQBLbiZVnMS3RtlchDuDEMkGAoE+PBABAQEBAQEBEQEBAQEBBg0JCRQuhCABAQMBIxVGCwQHGgImAgJXIYgaDLZZlnmBIYoKhBkRAViCaIFFBZwigzqQDAKEEoF5OX8BAQE X-IPAS-Result: A0CgAQBLbiZVnMS3RtlchDuDEMkGAoE+PBABAQEBAQEBEQEBAQEBBg0JCRQuhCABAQMBIxVGCwQHGgImAgJXIYgaDLZZlnmBIYoKhBkRAViCaIFFBZwigzqQDAKEEoF5OX8BAQE X-IronPort-AV: E=Sophos;i="5.11,549,1422918000"; d="scan'208";a="108971323" Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 09 Apr 2015 14:24:26 +0200 Received: from mfilter32-d.gandi.net (mfilter32-d.gandi.net [217.70.178.163]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 008421720BE for ; Thu, 9 Apr 2015 14:24:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter32-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter32-d.gandi.net (mfilter32-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id SdUtb7ss9wbr for ; Thu, 9 Apr 2015 14:24:24 +0200 (CEST) X-Originating-IP: 10.58.1.142 Received: from webmail.gandi.net (unknown [10.58.1.142]) (Authenticated sender: dario.teixeira@nleyten.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 75142172074 for ; Thu, 9 Apr 2015 14:24:24 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 09 Apr 2015 13:24:24 +0100 From: Dario Teixeira To: caml-list@inria.fr In-Reply-To: <1428576994.22412.21.camel@e130.lan.sumadev.de> References: <2f9c74beafcf41f3ab30324fb1ece739@nleyten.com> <55257AAD.6030004@zoho.com> <5297cdaceccd6db2a60700bf686ccfb7@nleyten.com> <1428576994.22412.21.camel@e130.lan.sumadev.de> Message-ID: X-Sender: dario.teixeira@nleyten.com User-Agent: Roundcube Webmail/0.9.5 Subject: Re: [Caml-list] META file standards for ppx extensions Hi, > There is still the question how to set the standard. Just talking > about it isn't sufficient. My thinking here is that there should > be a couple of pointers into the right direction giving advice to > the developers. There could be a good ppx example in the findlib > manual (or maybe a link to a blog post explaining the issue). Fair point. At the end of this email I'm posting a first draft of META samples for all ppx variations. (It's bound to be incomplete and/or contain errors, so please share additions and/or corrections!) > I'm also thinking about a helper inside ocamlfind, maybe > > ocamlfind check META > > that would (a) search for hard errors, and (b) give > recommendations. For example, if a library cannot be linked at all, > or not be loaded into the toploop, this would be (a). If the ppx > preprocessor isn't separated from the runtime, this would be (b) > (i.e. using ppx together with archive). That would be interesting indeed. > Do we have a project that could be used as reference for ppx? LWT is doing things the right way, I think. Best regards, Dario Teixeira #################################################################### META file skeletons for ppx extensions, 1st draft: Broadly, there's three types of packages defining ppx extensions: 1) libraries where ppx is optional candy, 2) primarily ppx extensions with mandatory runtime, and 3) primarily ppx extensions without runtime. I've named the sample packages for each case as Fooloot, Foolex, and Foonad, respectively. Below you'll find sample META files for each case. 1) Package "Fooloot" is like LWT: it's a library that can be used without a camlp4/ppx extension, but it also offers an optional camlp4 and/or ppx extension. ###### META begins ##### version = "1.0" description = "Fooloot library" archive(byte) = "fooloot.cma" archive(byte, plugin) = "fooloot.cma" archive(native) = "fooloot.cmxa" archive(native, plugin) = "fooloot.cmxs" package "syntax" ( version = "1.0" description = "Camlp4-based syntax extension for Fooloot" requires = "camlp4 fooloot" archive(syntax, preprocessor) = "pa_fooloot.cma" archive(syntax, toploop) = "pa_fooloot.cma" archive(syntax, preprocessor, native) = "pa_fooloot.cmxa" archive(syntax, preprocessor, native, plugin) = "pa_fooloot.cmxs" ) package "ppx" ( version = "1.0" description = "New-style (ppx) syntax extension for Fooloot" requires = "fooloot" ppx = "ppx_fooloot" ) ##### META ends ##### 2) Package "Foolex" is like Sedlex: it's used only as a ppx extension, but it requires a runtime. ###### META begins ##### version = "1.0" description = "Foolex library" archive(byte) = "foolex.cma" archive(byte, plugin) = "foolex.cma" archive(native) = "foolex.cmxa" archive(native, plugin) = "foolex.cmxs" package "ppx" ( version = "1.0" description = "New-style (ppx) syntax extension for Foolex" requires = "foolex" ppx = "ppx_foolex" ) ##### META ends ##### 3) Package "Foonad" is like ppx_monad: it's used only as a ppx extension, and it requires no runtime. ###### META begins ##### version = "1.0" description = "Foonad" package "ppx" ( version = "1.0" description = "New-style (ppx) syntax extension for Foonad" ppx = "ppx_foonad" ) ##### META ends #####