From: Arnaud Spiwack <Arnaud.Spiwack@lix.polytechnique.fr>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: Nicolas Pouillard <nicolas.pouillard@gmail.com>,
Caml_mailing list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Ocamlbuild with findlib + camlp4
Date: Mon, 10 Mar 2008 20:56:26 +0100 [thread overview]
Message-ID: <47D5926A.9070602@lix.polytechnique.fr> (raw)
In-Reply-To: <366498.253.qm@web54601.mail.re2.yahoo.com>
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 "<data.ml>:
> 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
>
>
next prev parent reply other threads:[~2008-03-10 19:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-05 13:41 Dario Teixeira
2008-03-05 15:08 ` [Caml-list] " Romain Bardou
2008-03-06 15:31 ` Dario Teixeira
2008-03-06 15:46 ` Pietro Abate
2008-03-06 19:45 ` Dario Teixeira
2008-03-06 22:14 ` Pietro Abate
2008-03-07 9:26 ` Romain Bardou
2008-03-07 14:46 ` Dario Teixeira
2008-03-07 15:01 ` Nicolas Pouillard
2008-03-07 16:12 ` Dario Teixeira
2008-03-08 11:36 ` Nicolas Pouillard
2008-03-10 15:33 ` Dario Teixeira
2008-03-10 16:15 ` Romain Bardou
2008-03-10 21:13 ` Dario Teixeira
2008-03-10 19:56 ` Arnaud Spiwack [this message]
2008-03-10 21:15 ` Dario Teixeira
2008-03-11 10:37 ` Nicolas Pouillard
2008-03-11 13:49 ` Romain Bardou
2008-03-11 15:03 ` Romain Bardou
2008-03-11 17:32 ` Dario Teixeira
2008-03-11 20:17 ` Richard Jones
2008-03-11 10:41 ` Nicolas Pouillard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47D5926A.9070602@lix.polytechnique.fr \
--to=arnaud.spiwack@lix.polytechnique.fr \
--cc=caml-list@yquem.inria.fr \
--cc=darioteixeira@yahoo.com \
--cc=nicolas.pouillard@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox