From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA03387; Thu, 26 Sep 2002 13:01:02 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA03388 for ; Thu, 26 Sep 2002 13:01:01 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.44.193]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8QB11509718 for ; Thu, 26 Sep 2002 13:01:01 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (localhost [127.0.0.1]) by dpt-info.u-strasbg.fr (8.12.3/8.12.3/Debian -4) with ESMTP id g8QB0w0r017010 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL); Thu, 26 Sep 2002 13:00:58 +0200 Received: (from luther@localhost) by dpt-info.u-strasbg.fr (8.12.3/8.12.3/Debian -4) id g8QB0w7X017009; Thu, 26 Sep 2002 13:00:58 +0200 From: Sven Date: Thu, 26 Sep 2002 13:00:58 +0200 To: Micha?l Gr?newald Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: We should start using -pack by default when building libraries, (was : Re: Meta module in findlib and the need for namespaces) Message-ID: <20020926110058.GA16817@dpt-info.u-strasbg.fr> References: <3D87406D.9010406@baretta.com> <20020922212920.GG914@ice.gerd-stolpmann.de> <20020923084301.GA1272@iliana> <20020923163619.A16997@pauillac.inria.fr> <20020924063041.GA1436@iliana> <87d6r2llnw.fsf@ketanu.dyndns.org> <20020925093229.GA1424@iliana> <87k7l9yicz.fsf@ketanu.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k7l9yicz.fsf@ketanu.dyndns.org> User-Agent: Mutt/1.3.28i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Sep 25, 2002 at 09:33:32PM +0200, Micha?l Gr?newald wrote: > Sven LUTHER writes: > > > > So every unmaintained code and Makefiles becomes all suddenly obsoletes ? > > > > unmaintained code is not good to have around anyway, it will most > > probably break some in the future anyway (when there is a ocaml 4.0 for > > example ?). > > Oc :) > > > > > > > This is a really bad thing to do things like this, and it is so easy to > > > write wrappers scripts over the compiler, so it has defaults suitable for > > > your needs ... There is no need to modify standards for that. > > > > But the change is only adding the appropriate open at the top of the > > files, i guess it could even be done with automatic translation or > > something such. > > > > Also, i guess the Pervasive library will be opened by default, and maybe > > also the standard library. > > > > This namespace problem is one that ocaml was having since a long time, > > and which will become only worse as time passes and more library will be > > written. So are you saying that we should stay with something that will > > cause more and more problem as time passes, just because some obsolete > > and unmaintained code will break in this case ? > > > > Anyway, this can be done in a painless incremental way. > > > > We decide that starting now, all libraries should use the -pack option > > when it is possible, and slowly migrate to using that for the existing > > code, but still keep the default behavior as usual. Later, when we are > > satisfied that it works well and most libraries are ported to using > > -pack (and the acompanying code using it also), we can modify the > > behavior to use -pack by default for libraries. > > But what if you compile only one module ? If you compile a.ml > ocamlc -c -o unnom.cmo a.cmo > will act like > ocamlc -pack -o unnom.cmo -c a.cmo and > i will have to access the A module through Unnom.A which is very disturbing, > isn't it ? Well, no, it would be used by default only when building libraries (.cma and such). So suppose you have a library calle Lib, which is composed of modules A, B and C. you would build A, B and C normally, and then do : ocamlmklib -pack -o lib.cma a.cmo b.cmo c.cmo, And then use the modules as : Lib.A, Lib.B, Lib.C, or even just do an open Lib at the begining of the source, and continue to use A, B and C normally. This would enable the libraries to have a private namespace, and thus you would have no problem with reusing names already used in other libraries (like the Meta we were discusing here). This will in no way affect the build of standalone .cmo. > I cannot understand why you wish a so strange behaviour, and Does it makes more sense if limited to libraries ? > - think that it is disturbing for beginners that use a compiler for the > first time, and ask them to read more doc on something that is not clearly > needed, so it makes more magic Well, It seems natural enough to me, that if you have a library called Gtk for example, containing a module Main, then you would use it as Gtk.Main. Also, beginners don't usually build libraries, so they will not be affected at all. > - wonder why you do not want use something like a makefile, and change your > compiler with $(OCAMLC) and having `OCAMLC=ocamlc -pack' if you really > find it useful. No, the problem is that we want each library to use its own namespace, so that there is no namespace polution, this has nothing whatsoever to do with makefiles. Alternatively, we could keep the compiler as is, and decide that the standard for libraries would be to use the -pack option. This would not need any change to the way the compiler works, but would need for libraries authors to do more advanced makefile stuff to build the libraries, and not everyone will maybe bother to do it. > - am leaded to think you try to set something that will coerce the users to > use a special type of organisation in their developpement (such as > namespace), in the ways of passivity, so that default behaviour is oc, and > since it is easier to do nothing than to do something, default will be > followed. This way has a lot of horrible names i do not want to write > here. It is better to convince every one this design is a good and shioul > be used, because people must do things they want (keywords are they and > want). > > > And btw, it is more natural to write, for example Gdk.Event.Button than > > GdkEvent.Button, as we do now, don't you think ? > > I do think so. But what has it to do with the `pack option enabled by > default' ? Like i said before, because the enabling by default is only for building .cmas. Sorry about the confussion. > > > > That said ... > > > > > > > > John Carr Wrote : > > > > > > > > | OCaml 3.06 does not support -pack when using native code on a system > > > > | without the GNU linker. If you release software that depends on -pack, > > > > | I will not be able to use it. > > > > > > > > Well, this would cause a problem, which need to be solved before -pack > > > > is supported as standard. What are exactly the cases were it causes > > > > problem, (AIX when not using the GNU linker, i guess, but also maybe > > > > windows ?) and is there any chance this can be solved soonly ? > > > > > > > > Alternatively, this could be a feature that could be enabled/disabled at > > > > build time ? > > > > > > E.g. with the `-pack' option ? :) > > > > At build time of the ocaml compiler suite, with a configure option, so > > that you could build an ocaml suite to either use -pack by default or > > not, and a ocamlc option to return the default used pack option, so you > > could use it to write the libraries accordyingly (well, maybe this is > > not easily). > > This sounds hairy (i mean: i am frightened !) ! Yes, sure, better to have it all work for all plateforms ... > How can you write Makefile that can compile an application on any > installation, when the change you eask about is applied (if i understand > it). With conditional rules depending on the result of ocamlc -pack-default or something such ? > you determine if the default behaviour is to pack or not to > you set a variable OCAMLC according to what you expect the compiler to do. > you use the OCAMLC variable in the place of `ocamlc' program Or like that also, but the definition of OCAMLC could be conditional. And anyway, it would be ocamlmklib which we redefine. > When it is not, and you want the apck option being ysed: > you set a variable OCAMLC=ocamlc -pack > you use the OCAMLC variable in the place of `ocamlc' program > > What is the simplest ? > > As you may noticed, i REALLY do not understand WHY you want the pack option > enabled by default (and it sounds really stupid to me, as i tried to > demonstrate it. I am not professional developper, so my point of view on > these problems might be more `naive' than yours, so be patient ... :) ) Ok, i hope this mail will lift the misunderstanding now. Friendly, 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