caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* BCP relating to -pack?
@ 2005-05-26 10:05 Alex Baretta
  2005-05-26 12:12 ` [Caml-list] " Richard Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Baretta @ 2005-05-26 10:05 UTC (permalink / raw)
  To: Ocaml

The AS/Xcaml and FreerP projects are now getting big enough that
namespace conflicts begin to emerge within them. We are thinking about
changing our build system so as to encapsulate libraries as single
cmo/cmi packages to introduce a hierarchy in the namespace. The problem
I foresee is that the -pack directive to the compiler breaks the code,
because all modules referring to module X within xyz.cma would need to
open module Xyz. Patching the entire project is in my opinion contrary
to the "a posteriori" approach to namespace management taken by the Caml
team with the -pack directive. So here is my question.

Has anyone already faced this kind of problem on a fairly large project
( ~ 100 kloc)? What are the Best Current Practices relating to -pack?

Alex

-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] BCP relating to -pack?
  2005-05-26 10:05 BCP relating to -pack? Alex Baretta
@ 2005-05-26 12:12 ` Richard Jones
  2005-05-26 12:38   ` Alex Baretta
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Jones @ 2005-05-26 12:12 UTC (permalink / raw)
  To: Alex Baretta; +Cc: Ocaml

A better way to create a hierarchical namespace seems to be to use
some character _other than_ '.' (dot) to separate the levels.

For instance:

  Pxp_document
  Net_httpclient   (nearly)

This allows a third party to come along and add packages to the same
"namespace", eg. Pxp_myextension.

Using dot / -pack doesn't allow extension and doesn't allow the package
to be spread over several cma files.

Rich.

(I'm not claiming that I've used this convention in my own packages,
but I ought to have done ...)

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] BCP relating to -pack?
  2005-05-26 12:12 ` [Caml-list] " Richard Jones
@ 2005-05-26 12:38   ` Alex Baretta
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Baretta @ 2005-05-26 12:38 UTC (permalink / raw)
  To: Richard Jones, Ocaml

Richard Jones wrote:
> A better way to create a hierarchical namespace seems to be to use
> some character _other than_ '.' (dot) to separate the levels.
> 
> For instance:
> 
>   Pxp_document
>   Net_httpclient   (nearly)

Given the current implementation of namespaces in Ocaml, I agree. For a
new project, I'd adopt this convetion. Currently, I have to decide
whether we have to change all module names to match a sensibile
convention, and consequently all references to the modules within the
code, or if we ought to package everything up with -pack. The second
solution is only viable if it does not break the current code, which is
currently not written with "open Library_name" directives. If this is
not possible, we'll have to stick with cmas and change module names all
over the place, which is highly undesirable.

If the namespace management could be entirely delegated to the command
line parameters of ocamlc, I'd be a happier man.

Alex

-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-26 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-26 10:05 BCP relating to -pack? Alex Baretta
2005-05-26 12:12 ` [Caml-list] " Richard Jones
2005-05-26 12:38   ` Alex Baretta

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).