caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Installation of libraries with ocamlbuild
Date: Tue, 03 Apr 2007 13:11:04 +1000	[thread overview]
Message-ID: <1175569864.7492.57.camel@rosella.wigram> (raw)
In-Reply-To: <93C44656-2FF9-43C0-862B-80A9654BFEAA@epfl.ch>

On Mon, 2007-04-02 at 21:02 +0200, Daniel Bünzli wrote:
> Le 2 avr. 07 à 20:11, skaller a écrit :
> 
> > The caml development team alone does not have the expertise
> > to develop such a model in isolation: it requires a discussion
> > and feedback from the wider community.
> 
> Maybe, maybe not. I find it very usefull they want to tackle this  
> problem, so I'd like to encourage them instead of dismissing the idea.

I am certainly not dismissing it: I merely said it was premature
to implement something. Unlike type systems .. it's not entirely
a matter of logic: whatever is implemented needs to cope with
'the real world' .. :)

> > I personally think the proper solution is actually SOURCE not binary.
> > That is, you install sources .. never binaries. Ocamlbuild uses a
> > nominated cache directory for the binaries, and rebuilds automatically
> > any libraries required .. including when Ocaml itself is upgraded.
> 
> This could be the sketch an interesting solution.

This is what Felix actually does do right now .. *except* I haven't
done the 'cache' part. AFAIK Sun Java also does it, as do most
scripting languages with bytecode compilers.

It's not entirely trivial (parallel compilation of the same file
might cause corruption).

Unfortunately the 'programs are source code' view requires language
support: you basically can't allow the compiler to accept switches
like -o and -pack. In Felix the support is designed into the language
to make the 'programs are source' work. For example bindings to
C libraries have to be specified in the source code, it's done
like this:

	type gtkWindow = "GTKWindows" requires package "gtk-2.0";

and the compiler outputs a resource file of all the packages
required, which are then mapped via a package database
(like pkg-config) to shared library objects that need to be
linked in.

Ocaml doesn't have that support directly, however auxiliary
files are a reasonable solution, such as the ones
ocamlbuild uses, however it is important, IMHO, to ensure
the first level of those files uses *abstract* names not
file names.

Unix tries to do that with C compiler

	-Lpath -llib

switches where the -l argument is abstract and the -L maps it
to a filename.

Gerd tried to do that with ocamlfind, using meta-data.

Things get REALLY interesting with a cross compilation model.
It's fairly essential to make such a system work with cross-compilation.

The reason is that the additional difficulty actually HELPS get the
ideas sorted out. For example you'll note that camlp4 code executes
on a quite different machine than the final executable in that
scenario .. so even on a host you should have to give TWO paths,
one for camlp4 and interfaces, and another one for linking.

Or something .. i'm confused. It's actually a hard problem,
roughly equivalent to a parallel distributed lazy evaluator.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


      reply	other threads:[~2007-04-03  3:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-02 10:37 Joel Reymont
2007-04-02 17:00 ` [Caml-list] " Nicolas Pouillard
2007-04-02 17:22   ` skaller
2007-04-02 17:42     ` Daniel Bünzli
2007-04-02 18:11       ` skaller
2007-04-02 19:02         ` Daniel Bünzli
2007-04-03  3:11           ` skaller [this message]

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=1175569864.7492.57.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@epfl.ch \
    /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).