* Namespace clash
@ 2006-02-08 13:28 Alessandro Baretta
2006-02-08 23:41 ` [Caml-list] " Jonathan Roewen
2006-02-09 5:08 ` Alain Frisch
0 siblings, 2 replies; 6+ messages in thread
From: Alessandro Baretta @ 2006-02-08 13:28 UTC (permalink / raw)
To: OCaml; +Cc: metaocaml-hackers-l
Gentlemen--most specifically Xavier,
Every other year I have mentioned on this list that I have encountered a module
name clash problem, rendering some bit of code unusable and my life very
miserable. It happened again today. Hence, this post, to help me relieve my
frustration.
Luckily, today I control one of the two modules whose names collide, so I can
easily overcome the problem by renaming one file and changing all relevant
references to it in a relativeley self-contained sub-project of my full source
tree. Were it otherwise, I'd be in trouble. Let me state that I am currently
managing a source tree comprising approximately ten man years of work and
236klocs as of today, including generated code. When a project grows to this
size, it is relatively easy to produce such name clashes.
The clashing modules are Liveness in the metanative.cmxa library of the
MetaOcaml project and a Liveness module in a PLC application based on my
AS/Xcaml. I realize that "liveness" is a meaningful word to a compiler author,
but it also is to a automation engineer. It is doubtful that either the
MetaOcaml team or I have a greater right to this name, and it is unreasonable to
renounce many useful words just because they might be of common interest.
Xavier's official position until now has been the following: "You guys have the
-pack option; use it." This is probably the best solution overall, but it is
hardly reconcilable with the fact that out there in the wild--and in my own
repository--there are truckloads and truckloads of code that don't use it and
that would need to be modified to use it, because of the need to explicity open
in the projects source files all referenced libraries. Hence, it is impossibile
for the build system to automatically manage namespacing issues.
Probably, all that ocaml lacks to properly handle namespacing is a -open
directive, telling the compiler to imply a "open Xxxx" at the beginning of all
.ml and .mli files on the command line. Given this compiler flag, the build
system could take care of everything.
I'm sure there are other ways to solve this issue, and I'm non really trying to
sell anyone my idea. As I stated, I'm just writing to relieve my frustration.
Alex
--
*********************************************************************
Ing. Alessandro Baretta
Studio Baretta
http://studio.baretta.com/
Consulenza Tecnologica e Ingegneria Industriale
Technological Consulting and Industrial Engineering
tel. +39 02 370 111 55
fax. +39 02 370 111 54
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] Namespace clash
2006-02-08 13:28 Namespace clash Alessandro Baretta
@ 2006-02-08 23:41 ` Jonathan Roewen
2006-02-09 5:08 ` Alain Frisch
1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Roewen @ 2006-02-08 23:41 UTC (permalink / raw)
To: Alessandro Baretta; +Cc: OCaml, metaocaml-hackers-l
I made such a modification to ocaml compiler to do this, and submitted
my patch to mantis. I don't know if Xavier et al care too much about
my patch, but it is fairly trivial to implement (a string list ref,
and a fold).
Jonathan
On 2/9/06, Alessandro Baretta <a.baretta@barettadeit.com> wrote:
> Gentlemen--most specifically Xavier,
>
> Every other year I have mentioned on this list that I have encountered a module
> name clash problem, rendering some bit of code unusable and my life very
> miserable. It happened again today. Hence, this post, to help me relieve my
> frustration.
>
> Luckily, today I control one of the two modules whose names collide, so I can
> easily overcome the problem by renaming one file and changing all relevant
> references to it in a relativeley self-contained sub-project of my full source
> tree. Were it otherwise, I'd be in trouble. Let me state that I am currently
> managing a source tree comprising approximately ten man years of work and
> 236klocs as of today, including generated code. When a project grows to this
> size, it is relatively easy to produce such name clashes.
>
> The clashing modules are Liveness in the metanative.cmxa library of the
> MetaOcaml project and a Liveness module in a PLC application based on my
> AS/Xcaml. I realize that "liveness" is a meaningful word to a compiler author,
> but it also is to a automation engineer. It is doubtful that either the
> MetaOcaml team or I have a greater right to this name, and it is unreasonable to
> renounce many useful words just because they might be of common interest.
>
> Xavier's official position until now has been the following: "You guys have the
> -pack option; use it." This is probably the best solution overall, but it is
> hardly reconcilable with the fact that out there in the wild--and in my own
> repository--there are truckloads and truckloads of code that don't use it and
> that would need to be modified to use it, because of the need to explicity open
> in the projects source files all referenced libraries. Hence, it is impossibile
> for the build system to automatically manage namespacing issues.
>
> Probably, all that ocaml lacks to properly handle namespacing is a -open
> directive, telling the compiler to imply a "open Xxxx" at the beginning of all
> .ml and .mli files on the command line. Given this compiler flag, the build
> system could take care of everything.
>
> I'm sure there are other ways to solve this issue, and I'm non really trying to
> sell anyone my idea. As I stated, I'm just writing to relieve my frustration.
>
> Alex
>
> --
> *********************************************************************
>
> Ing. Alessandro Baretta
>
> Studio Baretta
> http://studio.baretta.com/
>
> Consulenza Tecnologica e Ingegneria Industriale
> Technological Consulting and Industrial Engineering
>
> tel. +39 02 370 111 55
> fax. +39 02 370 111 54
>
> _______________________________________________
> 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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] Namespace clash
2006-02-08 13:28 Namespace clash Alessandro Baretta
2006-02-08 23:41 ` [Caml-list] " Jonathan Roewen
@ 2006-02-09 5:08 ` Alain Frisch
2006-02-09 11:12 ` Alessandro Baretta
1 sibling, 1 reply; 6+ messages in thread
From: Alain Frisch @ 2006-02-09 5:08 UTC (permalink / raw)
To: Alessandro Baretta; +Cc: OCaml
Alessandro Baretta wrote:
> Probably, all that ocaml lacks to properly handle namespacing is a -open
> directive, telling the compiler to imply a "open Xxxx" at the beginning
> of all .ml and .mli files on the command line. Given this compiler flag,
> the build system could take care of everything.
Couldn't you use the -pp option to achieve the same behavior?
-- Alain
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] Namespace clash
2006-02-09 5:08 ` Alain Frisch
@ 2006-02-09 11:12 ` Alessandro Baretta
2006-02-09 14:52 ` Damien Doligez
0 siblings, 1 reply; 6+ messages in thread
From: Alessandro Baretta @ 2006-02-09 11:12 UTC (permalink / raw)
To: Alain Frisch, Ocaml, metaocaml-hackers-l
Alain Frisch wrote:
> Alessandro Baretta wrote:
>
>> Probably, all that ocaml lacks to properly handle namespacing is a
>> -open directive, telling the compiler to imply a "open Xxxx" at the
>> beginning of all .ml and .mli files on the command line. Given this
>> compiler flag, the build system could take care of everything.
>
I had not thought about this... Actually, it is not a bad idea, at least, in my
build system. Ideally, the build system would have to have a way of mangling the
library namespace by packaging up findlib-managed libraries in a single package.
Then, it would have to isse the desired -open directives to an ad-hoc camlp4
syntax extension. It's a bit of a hack, but it could work. I wonder if it is
general enough a solution to become mainstream, though.
Alex
--
*********************************************************************
Ing. Alessandro Baretta
Studio Baretta
http://studio.baretta.com/
Consulenza Tecnologica e Ingegneria Industriale
Technological Consulting and Industrial Engineering
tel. +39 02 370 111 55
fax. +39 02 370 111 54
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] Namespace clash
2006-02-09 11:12 ` Alessandro Baretta
@ 2006-02-09 14:52 ` Damien Doligez
0 siblings, 0 replies; 6+ messages in thread
From: Damien Doligez @ 2006-02-09 14:52 UTC (permalink / raw)
To: Ocaml
On Feb 9, 2006, at 12:12, Alessandro Baretta wrote:
> I had not thought about this... Actually, it is not a bad idea, at
> least, in my build system. Ideally, the build system would have to
> have a way of mangling the library namespace by packaging up
> findlib-managed libraries in a single package. Then, it would have
> to isse the desired -open directives to an ad-hoc camlp4 syntax
> extension. It's a bit of a hack, but it could work. I wonder if it
> is general enough a solution to become mainstream, though.
It doesn't have to be a camlp4 extension, you could implement Alain's
trick
with a preprocessor written in Bourne shell. But it doesn't work
when the
program is already compiled with -pp, since the OCaml compiler doesn't
allow for a pipeline of preprocessors.
-- Damien
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] Namespace clash
@ 2006-02-09 19:32 yoann padioleau
0 siblings, 0 replies; 6+ messages in thread
From: yoann padioleau @ 2006-02-09 19:32 UTC (permalink / raw)
To: Damien Doligez, Ocaml
> > I had not thought about this... Actually, it is not a bad idea, at
> > least, in my build system. Ideally, the build system would have to
> > have a way of mangling the library namespace by packaging up
> > findlib-managed libraries in a single package. Then, it would have
> > to isse the desired -open directives to an ad-hoc camlp4 syntax
> > extension. It's a bit of a hack, but it could work. I wonder if it
> > is general enough a solution to become mainstream, though.
>
> It doesn't have to be a camlp4 extension, you could implement Alain's
> trick
> with a preprocessor written in Bourne shell. But it doesn't work
> when the
> program is already compiled with -pp, since the OCaml compiler doesn't
> allow for a pipeline of preprocessors.
You still can invent a script foo that successfully call your first bourne shell script bar and then
call camlp4.
Then you just pass -pp foo to ocaml.
Did I overlook something ?
>
> -- Damien
>
> _______________________________________________
> 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
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-02-09 19:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08 13:28 Namespace clash Alessandro Baretta
2006-02-08 23:41 ` [Caml-list] " Jonathan Roewen
2006-02-09 5:08 ` Alain Frisch
2006-02-09 11:12 ` Alessandro Baretta
2006-02-09 14:52 ` Damien Doligez
2006-02-09 19:32 yoann padioleau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox