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=1.0 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 7CF27BC6B for ; Tue, 6 Nov 2007 17:23:03 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADsjMEfOvjGtoWdsb2JhbACOfgEBAgUEBgkIARc X-IronPort-AV: E=Sophos;i="4.21,378,1188770400"; d="scan'208";a="5514636" Received: from web54603.mail.re2.yahoo.com ([206.190.49.173]) by mail3-smtp-sop.national.inria.fr with SMTP; 06 Nov 2007 17:23:02 +0100 Received: (qmail 93523 invoked by uid 60001); 6 Nov 2007 16:23:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=CscaGAOJSk0KmX3ZLe0vb1ml1/k3TqroSsi16mzDzVLz2OCdfrigAvGL7JVwuNP2Bdhf2lWmvpdtsWChxAHtSYUaI94c60KMy+qfiMh9UXSQFc0xhhr5yFgedBtWsXQHke9YIgZovzjJ6fpaN2FDotkj4qRz5FkNf8XwL/Cdhq0=; X-YMail-OSG: YmLeSOgVM1mKRvMP3K3ihWtjcM4QO2Kq7jLoxfoytAzcu.bIiMvmaol0g.mL6L1O5KQsZ1HW.ufEcsyVOudrtR1CqIWr5nCXnZahA.cyMtpxJ_mdLxjX_Acj8mbn Received: from [85.240.88.109] by web54603.mail.re2.yahoo.com via HTTP; Tue, 06 Nov 2007 16:23:01 GMT Date: Tue, 6 Nov 2007 16:23:01 +0000 (GMT) From: Dario Teixeira Subject: Re: [Caml-list] Ocamlbuild plugins To: Nicolas Pouillard Cc: caml-list In-Reply-To: <1194356522-sup-8476@ausone.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <402653.93475.qm@web54603.mail.re2.yahoo.com> X-Spam: no; 0.00; ocaml:01 ocamlfind:01 compiler:01 -package:01 flags:01 -package:01 camlp:01 ocaml:01 ocamldep:01 flags:01 grammatical:01 yap:98 compile:01 parsing:01 clearer:01 Hi, And thanks a lot for your reply! > On my page [1] there is also a plugin example [2] and the API [3], > where the module signature [4] can be a good starting point about what > tools we have in an ocamlbuild plugin. I had seen those; what was missing was an overview of what exactly was a plugin, and how it was supposed to be called -- the big picture stuff. > There is certainly some missing pieces. Roughly an ocamlbuild plugin > is an OCaml module called Myocamlbuild that should take place a > the root of your project (myocamlbuild.ml). Automatically ocamlbuild > will take care of it by compiling it and by making a myocamlbuild > binary that is the classical ocamlbuild plus your module. Yeap, I kind of assumed something like that was going on, though of course I wasn't sure about the details. This little piece of information would have made a huge difference if it was included in the documentation! Also, when introducing a new library, it is always good practice to fully qualify values. I know that for people used to a library this might seem like a waste of time, but for those learning it makes everything a lot clearer. > Firstly since you want to use ocamlfind you should start with this plugin I have looked into it, but it has one huge problem: it assumes that all files will use the same packages. Though in practice it doesn't hurt to pass unnecessary packages to the compiler, it's still killing a fly* with a bazooka. Moreover, while the comment at the bottom of that page addresses this issue ("A more fine grained version can provide specific -package options depending on the compiled file. This can be easily done using the tag system"), I find the use of "this can easily be done" a bit ironic given the present meagerness of Ocamlbuild's documentation... > let flags in = S[A"-package"; A"pgocaml.statements"; A"-syntax"; A"camlp4o"] in > flag ["ocaml"; "compile"; "use_pgocaml_statements"]; > flag ["ocaml"; "ocamldep"; "use_pgocaml_statements"]; > > You can then tag your files in the _tags file: > > "database.ml": use_pgocaml_statements, thread Yap, that was precisely what I wanted to express. Though I am having trouble parsing that example you just gave. Is "flag" the function "flag" from module Flags, or just a misspelling of the "flags" value you just declared? Also, "let flags in" doesn't seem grammatical. (This just illustrates the need of always using fully qualified values when giving examples!). > I don't know if GODI properly install as many things as ocamlbuild needs. I would assume it does, but perhaps the GODI folks can enlighten us on that? Anyway, thanks again for your help, and I hope you'll find the time to expand a little on the user guide... It seems the biggest obstacle to a wider adoption of Ocamlbuild is the lack of proper documentation (a common complaint in the OCaml world, unfortunately). Kind regards, Dario *Note: no flies were actually hurt during the writing of this post. ________________________________________________________ Nervous about who has your email address? Yahoo! Mail can help you win the war against spam. http://uk.docs.yahoo.com/mail/addressguard2.html