caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Arnaud Spiwack <Arnaud.Spiwack@lix.polytechnique.fr>
To: Xavier Clerc <xavier.clerc@inria.fr>
Cc: Edgar Friendly <thelema314@gmail.com>,
	OCaML Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] About ocamlbuild
Date: Fri, 16 Nov 2012 11:33:06 +0100	[thread overview]
Message-ID: <CAMoPVjeChbZ9uGiY6y-UxKVniQN2WcrqJP4iM9WpX=DQDzGxmA@mail.gmail.com> (raw)
In-Reply-To: <331585634.4160435.1353019001535.JavaMail.root@inria.fr>

[-- Attachment #1: Type: text/plain, Size: 4372 bytes --]

Well,

I must say the sort of mafioso-like reasoning ­- "you really do not want to
do that" - doesn't really make sense to me.

Here are valid reasons not to include a feature X in a tool:

   - I don't have time to do X
   - I don't know how to do X
   - Having X would prevent me from having Y which I'd rather

Any other reason is bad.

People want to have tags and compilation pragmas? Well, let them, they
probably have valid reasons to (some options may be better seen global to
the project and other local to files). People want to interleave compiling
the build system and compiling the project. They have a good reason for
that too. Also: ocamlbuild doesn't only compile ocaml files.

Related to that last point, and to the initial question: as far as I'm
aware, an ocamlbuild plugin cannot depend on a custom library (to go around
that we can use a myocamlbuild.ml which compiles a mymyocamlbuild.ml (or
something) with the appropriate linking options, then copy it in a
_build_stage2 directory, then Unix.excv an ocamlbuild -no-plugin -build-dir
_build_stage2. It would be nice if there were a standard and simple way to
do this sort of thing). In particular there is no principled way to
distribute a tool together with an ocamlbuild library against which to
compile our myocamlbuild.ml plugins (hence extending what ocamlbuild can
"natively" compile).



On 15 November 2012 23:36, Xavier Clerc <xavier.clerc@inria.fr> wrote:

> ----- Mail original -----
> > On 11/15/2012 4:48 PM, Xavier Clerc wrote:
> > >> 3 - Finally, I find the idea of tags good, for backward
> > >> compatibility
> > >> reasons (you do not have to change your code), but not enough. For
> > >> instance, in haskell (and some compilers written in ocaml), you
> > >> can
> > >> add "tags" at the beginning of your files. You would start your
> > >> ocaml files with comments such as:
> > >>
> > >> (* #OPTIONS -rectypes *)
> > > Well, I find tags pretty convenient, and do not dislike the comment
> > > approach. However, I am pretty sure I do not want the related
> > > information
> > > to be scattered over multiple locations.
> > It's exactly this reason that I'm strongly in favor of magic comments
> > or
> > pragmas or something in .ml files to do do this kind of thing.
> > Splitting the data needed to compile a module into two parts: the
> > module
> > and a makefile (or _tags or OMakefile or whatever) seems a violation
> > of
> > your "multiple locations" policy.
>
> I do not follow your line of thought: every information about how to
> compile is clearly in build files, and not in source code files.
> If I wonder how the command-line for a given compilation is determined,
> there is only one place to look.
>
> Again, I do not claim that the current state of affairs (everything
> in build files) is better than a pure pragma-based solution (everything
> in source files). My objection is about a mixed system where one should
> have to consult both build and source file in order to know which
> options are passed to compile a given module.
>
>
> > While I grant that some
> > compilation
> > options (whether to compile in debug/profiling/native mode, location
> > of
> > external libraries) should not be included in a source file, I'm
> > strongly in favor of having the build system work out the details of
> > dependencies (internal to project and external, installed in global
> > location) and even what camlp4 to run based on the contents of the
> > file
> > itself and not elsewhere.
>
> To be fair, I should point out that Coq is extracting camlp4 information
> from source files in order to determine how to treat them.
>
>
> Just a final remark: compared to Haskell, OCaml compilers feature a limited
> number of command-line switches having an influence on the semantics of a
> source file(*). I regard this as a pleasant thing, and think this makes the
> issue at hand quite minor.
>
>
> Kind regards,
>
> Xavier Clerc
>
>
>
>
> (*) we are only talking about labels, applicative functors, and recursive
> types
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 5495 bytes --]

  reply	other threads:[~2012-11-16 10:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15 12:05 Pierre-Etienne Meunier
2012-11-15 21:48 ` Xavier Clerc
2012-11-15 22:04   ` Edgar Friendly
2012-11-15 22:36     ` Xavier Clerc
2012-11-16 10:33       ` Arnaud Spiwack [this message]
2012-11-16 10:53         ` Gabriel Scherer
2012-11-16 11:43           ` Pierre-Etienne Meunier
2012-11-16 19:05             ` [Caml-list] " Hongbo Zhang
2012-11-16 19:33               ` [Caml-list] " Wojciech Meyer
2012-11-17 17:21             ` Fabrice Le Fessant
2012-11-16 11:01         ` Daniel Bünzli

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='CAMoPVjeChbZ9uGiY6y-UxKVniQN2WcrqJP4iM9WpX=DQDzGxmA@mail.gmail.com' \
    --to=arnaud.spiwack@lix.polytechnique.fr \
    --cc=caml-list@inria.fr \
    --cc=thelema314@gmail.com \
    --cc=xavier.clerc@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).