From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3A14BBBC1 for ; Mon, 10 Mar 2008 20:56:31 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUGAKcv1UdIDvyfYmdsb2JhbACQdAIVBAMKChEEk2GFSQ X-IronPort-AV: E=Sophos;i="4.25,476,1199660400"; d="scan'208";a="23598552" Received: from po-out-1718.google.com ([72.14.252.159]) by mail4-smtp-sop.national.inria.fr with ESMTP; 10 Mar 2008 20:56:30 +0100 Received: by po-out-1718.google.com with SMTP id y22so3424778pof.3 for ; Mon, 10 Mar 2008 12:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=kTOmtN/4rcVTHbgz00hjwLJNSUXMbmwWLMturfiZCBA=; b=UIgvQuNyTPmzXqqS+lziAtNUPLRA42xSM0ofUwU3lTWr22i2k+9DkqBmt7ObPlFbh/YQ/jkwzxgRT4AxuIjYeS2uLImxbfwem9AEwRB694Sm3TMiKqdgCDNBZ70ZEFae4GDoK/bojKgsswhVPZAxi9fDxkcDYNTShF3JS0tOgFY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=sqYEL17w0022nC0GsVUiRmWw38tSlLL/eDzGXsxtVZfLhWjHkuviIXaQ8T85U2dcrPdGMgq/fyKqbu9mj31eIjXPxWOnq+Qmud0RaAmJQa29sRe8N6UvsEYyC7uJSXY2TnC0E5/W0m9Wf/S1D/OXIEK1nefCSA+94q9iqydVkEM= Received: by 10.141.133.14 with SMTP id k14mr3524012rvn.127.1205178988563; Mon, 10 Mar 2008 12:56:28 -0700 (PDT) Received: from ?192.168.0.2? ( [87.88.165.197]) by mx.google.com with ESMTPS id i30sm9363232ugd.38.2008.03.10.12.56.26 (version=SSLv3 cipher=RC4-MD5); Mon, 10 Mar 2008 12:56:27 -0700 (PDT) Message-ID: <47D5926A.9070602@lix.polytechnique.fr> Date: Mon, 10 Mar 2008 20:56:26 +0100 From: Arnaud Spiwack User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Dario Teixeira Cc: Nicolas Pouillard , Caml_mailing list Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4 References: <366498.253.qm@web54601.mail.re2.yahoo.com> In-Reply-To: <366498.253.qm@web54601.mail.re2.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: Arnaud Spiwack X-Spam: no; 0.00; lix:01 findlib:01 camlp:01 camlp:01 findlib:01 wiki:01 ocamlfind:01 ocamlc:01 foo:01 ocamlfind:01 ocaml:01 syntax:01 syntax:01 bigarray:01 byte:01 Hi, I happen to have an *almost* generic ocamlbuild plugin that calls upon camlp4 and findlib. Actually it is meant at compiling ulex files. But it is mostly the idea. However, it is still messy and need to be cleaned up before being put on the wiki. The general idea is that it does *not* use ocamlfind ocamlc bar.ml -syntax foo. It actually proceeds in two parts. The first part consists in querying with ocamlfind query (using the shell, so it is not much of a clean part) to get the list of files to pass to the preprocessor, then uses camlp4 with the marshalled AST printer (there is also a target to build a pretty printed OCaml file from the file with syntax extension. This is mostly useful for debugging your own syntax extensions though). The second part consists in compiling this marshalled AST (using Findlib again to locate the .cm{i,o,a} that need to be linked or used at typing time). I'll try to get that online ASAP. Arnaud Spiwack Dario Teixeira a écrit : >> Nice! Apart the link with findlib.cma that is not supported yet and could >> be with the multiple-plugins support in ocamlbuild. I think that one can >> easily build a generic plugin for ocamlfind packages. >> > > Hi, > > I hope so too. However, note that no one has managed yet to provide a solution > to my original question, namely of integrating Ocamlbuild with findlib *and* > camlp4. Perhaps I should have explained better what this entails: > > Suppose you are using the Sexplib syntax extension. This syntax extension > depends on Sexplib itself and on another syntax extension, offered by the > Type-conv package. The META package for Sexplib should contain the following: > (note that the version currently shipping with GODI is incomplete) > > ############################################################### > name="sexplib" > version="3.0.0" > description="Sexplib - automated S-expression conversions" > requires="bigarray" > archive(byte)="sexplib.cma" > archive(native)="sexplib.cmxa" > > package "statements" ( > requires = "sexplib,type-conv.statements,camlp4" > version = "3.0.0" > description = "Syntax extension for Sexplib" > archive(syntax,preprocessor) = "pa_sexp_conv.cmo" > archive(syntax,toploop) = "pa_sexp_conv.cmo" > ) > ############################################################### > > > To compile with Findlib a data.ml file that makes use of the Sexplib syntax > extension is very simple. You just have to specify the "sexplib.statements" > package, and findlib will *automatically* take care of also loading libraries > or even other syntax extensions needed by sexplib.statements: > > ocamlfind ocamlc -package sexplib.statements -syntax camlp4o -c data.ml > > > Why am I insisting on this? Because when we manage to integrate these > three tools, we will essentially have solved the very common request of > providing easy access to common syntax extensions (just last week there was > an OSR on this subject). All that will be required to compile a file such as > data.ml using the Sexplib syntax extension will be to add a line ": > use_sexplib.statements" to the _tags file. You won't even need to create > a custom Ocamlbuild plugin or anything, because this findlib support could > be provided by a default plugin (living on $HOME/.ocamlbuild or something). > > So, Nicolas, is this altogether feasible with the current Ocamlbuild? > (And if so, could you lent us a hand -- you are of course the most > competent person to do so). > > Kind regards, > Dario > > > > ___________________________________________________________ > Rise to the challenge for Sport Relief with Yahoo! For Good > > http://uk.promotions.yahoo.com/forgood/ > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >