caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] packing Ocaml standard library into Std "namespace"
@ 2002-08-24 21:42 Dmitry Bely
  2002-08-24 22:55 ` Maxence Guesdon
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Bely @ 2002-08-24 21:42 UTC (permalink / raw)
  To: caml-list

Ocaml 3.05 and above introduces new packing facility (ocamlc "-pack"
option). What do you think of using it to pack all Ocaml standard modules
into one big Std module so that the user code could use them as
Std.List.something, Std.Array.something etc. (having an analog of C++
std:: namespace)?

Of course, the old "flat" standard modules should also be left in the
distribution to preserve existing code compatibility, but their direct use
will be deprecated (or not recommended).

I think this will help us reduce the name clash dramatically. E.g. I have
just discovered that I cannot modify ocamlild compiler to use Array.of_list
somethere inside, because it already contains array.ml source file, that
overlaps standard Array module. Having Std module, I just would write
Std.Array.of_string there.

How do you think, does this make any sense?

- Dmitry Bely


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] packing Ocaml standard library into Std "namespace"
  2002-08-24 21:42 [Caml-list] packing Ocaml standard library into Std "namespace" Dmitry Bely
@ 2002-08-24 22:55 ` Maxence Guesdon
  2002-08-25  8:33   ` Sven LUTHER
  2002-08-25  9:44   ` Dmitry Bely
  0 siblings, 2 replies; 4+ messages in thread
From: Maxence Guesdon @ 2002-08-24 22:55 UTC (permalink / raw)
  To: Dmitry Bely; +Cc: caml-list

Hi,

> Ocaml 3.05 and above introduces new packing facility (ocamlc "-pack"
> option). What do you think of using it to pack all Ocaml standard modules
> into one big Std module so that the user code could use them as
> Std.List.something, Std.Array.something etc. (having an analog of C++
> std:: namespace)?

Hum, Using Std.List.iter instead of just List.iter would be a pain
for me since I never 'open' standard modules. I could still open Std
at the beginning of each module but the best would then for the Std
module to be open by default (like Pervasives is).

But there may be a problem (correct me if i'm wrong): 
if I don't use, say Arg, in my program, the Arg module doesn't appear
in the executable. But if it is packed in std.cmo then Std.Arg will
be in my executable (as part of Std), as all the other standard
modules I don't use. Is that true ?

> I think this will help us reduce the name clash dramatically. E.g. I have
> just discovered that I cannot modify ocamlild compiler to use Array.of_list
> somethere inside, because it already contains array.ml source file, that
> overlaps standard Array module. Having Std module, I just would write
> Std.Array.of_string there.
And can't you pack the new array module in another one, hiding the new
Array and letting the standard one visible ?

-- 
Maxence Guesdon
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] packing Ocaml standard library into Std "namespace"
  2002-08-24 22:55 ` Maxence Guesdon
@ 2002-08-25  8:33   ` Sven LUTHER
  2002-08-25  9:44   ` Dmitry Bely
  1 sibling, 0 replies; 4+ messages in thread
From: Sven LUTHER @ 2002-08-25  8:33 UTC (permalink / raw)
  To: Maxence Guesdon; +Cc: Dmitry Bely, caml-list

On Sun, Aug 25, 2002 at 12:55:07AM +0200, Maxence Guesdon wrote:
> Hi,
> 
> > Ocaml 3.05 and above introduces new packing facility (ocamlc "-pack"
> > option). What do you think of using it to pack all Ocaml standard modules
> > into one big Std module so that the user code could use them as
> > Std.List.something, Std.Array.something etc. (having an analog of C++
> > std:: namespace)?
> 
> Hum, Using Std.List.iter instead of just List.iter would be a pain
> for me since I never 'open' standard modules. I could still open Std
> at the beginning of each module but the best would then for the Std
> module to be open by default (like Pervasives is).

Yes, that would be a good solution.

> But there may be a problem (correct me if i'm wrong): 
> if I don't use, say Arg, in my program, the Arg module doesn't appear
> in the executable. But if it is packed in std.cmo then Std.Arg will
> be in my executable (as part of Std), as all the other standard
> modules I don't use. Is that true ?

Does the exectuable only contain the used code anyway ? I thought it was
so, and if it is not so, then maybe it should.

Otherwise, we would need something like strip to remove the unused
parts.

But really, my impression was that when creating an executable, ocamlc
only copies the really used functions over to it, i may be wrong still.

Also, we should do this kind of thing for all third party libraries,
especially those which have more than one module.

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] packing Ocaml standard library into Std "namespace"
  2002-08-24 22:55 ` Maxence Guesdon
  2002-08-25  8:33   ` Sven LUTHER
@ 2002-08-25  9:44   ` Dmitry Bely
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Bely @ 2002-08-25  9:44 UTC (permalink / raw)
  To: caml-list

Maxence Guesdon <maxence.guesdon@inria.fr> writes:

>> Ocaml 3.05 and above introduces new packing facility (ocamlc "-pack"
>> option). What do you think of using it to pack all Ocaml standard modules
>> into one big Std module so that the user code could use them as
>> Std.List.something, Std.Array.something etc. (having an analog of C++
>> std:: namespace)?
>
> Hum, Using Std.List.iter instead of just List.iter would be a pain
> for me since I never 'open' standard modules. I could still open Std
> at the beginning of each module but the best would then for the Std
> module to be open by default (like Pervasives is).

Well, altough I think Std should not be open by default (to not pollute
user namespace), I realise that a lot of existing code will have to be
modified then. Some time ago C++ community survived a similar change,
 but ... maybe to control this via a compiler option, say "-nostd" (like
"-nopervasives")?

> But there may be a problem (correct me if i'm wrong): 
> if I don't use, say Arg, in my program, the Arg module doesn't appear
> in the executable. But if it is packed in std.cmo then Std.Arg will
> be in my executable (as part of Std), as all the other standard
> modules I don't use. Is that true ?

Hmm, I did not tested that, but does not "ocamlc -pack -a" create the
necessary library, where all submodules are independent? At least
ocamlc/ocamlopt accepts such set of options :-)

>> I think this will help us reduce the name clash dramatically. E.g. I have
>> just discovered that I cannot modify ocamlild compiler to use Array.of_list
>> somethere inside, because it already contains array.ml source file, that
>> overlaps standard Array module. Having Std module, I just would write
>> Std.Array.of_string there.
> And can't you pack the new array module in another one, hiding the new
> Array and letting the standard one visible ?

No, because other ocamlild modules use that array.ml. So I have to modify
many files to get access to the standard Array module...

- Dmitry Bely


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2002-08-25  9:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-24 21:42 [Caml-list] packing Ocaml standard library into Std "namespace" Dmitry Bely
2002-08-24 22:55 ` Maxence Guesdon
2002-08-25  8:33   ` Sven LUTHER
2002-08-25  9:44   ` Dmitry Bely

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