caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] Namespace proposal
@ 2002-08-15 16:21 Gurr, David (MED, self)
  2002-08-15 17:00 ` Vitaly Lugovsky
  2002-08-18 17:05 ` [Caml-list] " John Max Skaller
  0 siblings, 2 replies; 8+ messages in thread
From: Gurr, David (MED, self) @ 2002-08-15 16:21 UTC (permalink / raw)
  To: Vitaly Lugovsky, Yurii A. Rashkovskii; +Cc: caml-list

My two cents worth: Please dont copy package ideas from 
languages that lack functors.  And Java's package ==
directory idea is far from beloved by all.  -D

> -----Original Message-----
> From: Vitaly Lugovsky [mailto:vsl@ontil.ihep.su]
> Sent: Thursday, August 15, 2002 8:53 AM
> To: Yurii A. Rashkovskii
> Cc: caml-list@inria.fr
> Subject: Re: [Caml-list] Namespace proposal
> 
> 
> On Thu, 15 Aug 2002, Yurii A. Rashkovskii wrote:
> 
> > Hi Vitaly!
> > 
> > >  I think that the best and the most natural solution is something
> > > like Java or Python packages...
> > 
> > Well, as it was proposed in original mail :)
> 
>  I mean slightly different approach: no need in any syntax sugar, but
> only using the directory structure. It's much better then cifering 
> package contents and names inside Makefiles, and it does not need any
> significiant modifications to the existing OCaml code.
> 
> 
> 
> -------------------
> 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
-------------------
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] 8+ messages in thread

* RE: [Caml-list] Namespace proposal
  2002-08-15 16:21 [Caml-list] Namespace proposal Gurr, David (MED, self)
@ 2002-08-15 17:00 ` Vitaly Lugovsky
  2002-08-15 21:08   ` [Caml-list] " Michaël Grünewald
  2002-08-18 17:05 ` [Caml-list] " John Max Skaller
  1 sibling, 1 reply; 8+ messages in thread
From: Vitaly Lugovsky @ 2002-08-15 17:00 UTC (permalink / raw)
  To: Gurr, David (MED, self); +Cc: Yurii A. Rashkovskii, caml-list

On Thu, 15 Aug 2002, Gurr, David (MED, self) wrote:

> My two cents worth: Please dont copy package ideas from 
> languages that lack functors.  And Java's package ==
> directory idea is far from beloved by all.  -D

 For me package is not a modules collection, but just
a way of multi-word module naming. It's not so easy to
give short and still adequate names to the modules, but
something like Db.Core.Storage looks much better then
Dbstorage, and Storage can still be accessed just as
"Storage" from modules of the same "package". Just a naming
way, nothing more.




-------------------
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] 8+ messages in thread

* [Caml-list] Re: Namespace proposal
  2002-08-15 17:00 ` Vitaly Lugovsky
@ 2002-08-15 21:08   ` Michaël Grünewald
  0 siblings, 0 replies; 8+ messages in thread
From: Michaël Grünewald @ 2002-08-15 21:08 UTC (permalink / raw)
  To: caml-list

Vitaly Lugovsky <vsl@ontil.ihep.su> writes:

> On Thu, 15 Aug 2002, Gurr, David (MED, self) wrote:
> 
> > My two cents worth: Please dont copy package ideas from 
> > languages that lack functors.  And Java's package ==
> > directory idea is far from beloved by all.  -D
> 
>  For me package is not a modules collection, but just
> a way of multi-word module naming. It's not so easy to
> give short and still adequate names to the modules, but
> something like Db.Core.Storage looks much better then
> Dbstorage, and Storage can still be accessed just as
> "Storage" from modules of the same "package". Just a naming
> way, nothing more.

[...]

You can have modules with a name

Veryvery.LOng.But.self.ExPl4n4t0ry.N4m3

that can be hard to type and read, but by saying

module Forshort = Veryvery.LOng.But.self.ExPl4n4t0ry.N4m3
module Storage = Db.Core.Storage

you will have shorter names that can be hidden, by removing them in the
signature file.
-- 
Michaël Grünewald <michael-grunewald@wanadoo.fr>  - RSA PGP Key ID: 0x20D90C12
-------------------
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] 8+ messages in thread

* Re: [Caml-list] Namespace proposal
  2002-08-15 16:21 [Caml-list] Namespace proposal Gurr, David (MED, self)
  2002-08-15 17:00 ` Vitaly Lugovsky
@ 2002-08-18 17:05 ` John Max Skaller
  2002-08-30 18:02   ` [Caml-list] Namespace proposal: XML variant Alessandro Baretta
  1 sibling, 1 reply; 8+ messages in thread
From: John Max Skaller @ 2002-08-18 17:05 UTC (permalink / raw)
  To: Gurr, David (MED, self); +Cc: Vitaly Lugovsky, Yurii A. Rashkovskii, caml-list

Gurr, David (MED, self) wrote:

> My two cents worth: Please dont copy package ideas from 
> languages that lack functors.  And Java's package ==
> directory idea is far from beloved by all.  -D

While I agree that 'package == directory' has problems,
languages that do not properly allow installation
of third party packages in such a way as to avoid
name clashes in supporting components, have even
more problems.

Ocaml is in this position. It can't be easily
use in large projects which incorporate many third
party libraries.

Separable installation
is possible but clumbsy (use OCAMLPATH),
but there is no associated mechanism for nameclash avoidance.

In theory, one could use nested modules to avoid nameclashes.
In practice that is out of the question because
it requires all the modules be in one file.

C had exactly the same problem, which is why
C++ added namespaces (independently of
file locations). Python had this problem,
which is why it added packages (dependent on
directory structure).

I personally favour the Eiffel approach because
it is the most flexible -- the dependence of
top level component names on files/directories
is defined by a secondary configuration language.
However, it is a somewhat heavy approach.

One thing is for sure though. The ability to install
third party packages in directories, and the ability
to avoid name clashes in supporting components,
are both required for programming in the large.

Ocaml is so close to a solution: both separable
installation and name clash avoidance are possible,
but the mechanisms cannot be easily integrated.

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850


-------------------
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] 8+ messages in thread

* Re: [Caml-list] Namespace proposal: XML variant
  2002-08-18 17:05 ` [Caml-list] " John Max Skaller
@ 2002-08-30 18:02   ` Alessandro Baretta
  2002-08-30 20:25     ` Jeffrey Palmer
  0 siblings, 1 reply; 8+ messages in thread
From: Alessandro Baretta @ 2002-08-30 18:02 UTC (permalink / raw)
  To: Ocaml

I thoroughly dislike any "package ~= directory" solution, 
yet I think a namespace construct should be present in the 
language in order to allow interoperability between 
different projects with different naming conventions. I 
propose a scheme à la XML, where namespaces are URIs 
belonging to the person or organization which releases the 
associated code.

I propose to add an optional namespace construct to 
explicitly associate namespace URIs with namespace names.

namespace MyBigProject = "http://alexbaretta.com/big_project/"


module Foobar in MyBigProject = ...

When I want to use somebody else's code I code just define a 
namespace name. Consider, for example, that I need to use 
Pxp in my project. Nowadays, I'd have to write

open Pxp_document
open Pxp_yacc

With my scheme I'd write

namespace Pxp = 
"http://www.ocaml-programming.de/programming/pxp.html"
(* or whatever URI Gerd might choose. *)

open Document in Pxp;
open Yacc in Pxp;
(* Assuming Gerd would adopt this namespace scheme *)

This is very very similar to the approach taken by XML. I 
think this is the model we should refer to when discussing a 
namespace scheme for OCaml. This technique only serves the 
purpose of avoiding name clashes between modules: every 
module name lives within the namespace belonging to and 
defined by the author. No assumptions are made w/respect to 
directory structure. Yet, the build evironment, with some 
help from such a program as ocamldep, could extract 
information from the namespace URIs and use it as a hint for 
source file search. Yet, harnessing URI for the sake of 
filename resolution would be entirely optional and delegated 
to the build environment.

I hope to get some feedback on this proposal. What do you 
guys think about it?

Alex

-------------------
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] 8+ messages in thread

* Re: [Caml-list] Namespace proposal: XML variant
  2002-08-30 18:02   ` [Caml-list] Namespace proposal: XML variant Alessandro Baretta
@ 2002-08-30 20:25     ` Jeffrey Palmer
  2002-08-30 22:39       ` james woodyatt
  2002-08-30 22:51       ` Blair Zajac
  0 siblings, 2 replies; 8+ messages in thread
From: Jeffrey Palmer @ 2002-08-30 20:25 UTC (permalink / raw)
  To: caml-list

On Friday 30 August 2002 01:02 pm, Alessandro Baretta wrote:
> I thoroughly dislike any "package ~= directory" solution,
> yet I think a namespace construct should be present in the
> language in order to allow interoperability between
> different projects with different naming conventions. I
> propose a scheme à la XML, where namespaces are URIs
> belonging to the person or organization which releases the
> associated code.
>
> I propose to add an optional namespace construct to
> explicitly associate namespace URIs with namespace names.
>
> namespace MyBigProject = "http://alexbaretta.com/big_project/"
>
>

Eeek!

Please, let's not entertain any of the rampant stupidity that the W3C seems so 
mired in. I've always thought that the concept of using URIs for namespaces, 
parameter settings, etc., was the most ridiculous thing I've ever seen. I 
mean, let's be honest here - HTTP is a network _protocol_, and it has nothing 
to do with anything namespace or parameter related. The thing that really 
irks me about the whole scheme is that most of the time these aren't even 
_valid_ URIs (i.e., inaccessible).

I'm all for a hierarchical namespace that's not related to the filesystem (In 
Java it always ended up causing headaches for large projects - compilers that 
"intelligently" put your compiled code in the correct package directory, 
etc.). It seems that the question of segmenting libraries according to 
directory should be a decision that's left up to the implementor, as it is 
currently.

All of this is, of course, my own opinion, so take it with the corresponding 
pinch of salt.

Cheers,

	- j


-- 
The river is moving.
The blackbird must be flying.

-------------------
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] 8+ messages in thread

* Re: [Caml-list] Namespace proposal: XML variant
  2002-08-30 20:25     ` Jeffrey Palmer
@ 2002-08-30 22:39       ` james woodyatt
  2002-08-30 22:51       ` Blair Zajac
  1 sibling, 0 replies; 8+ messages in thread
From: james woodyatt @ 2002-08-30 22:39 UTC (permalink / raw)
  To: Jeffrey Palmer; +Cc: caml-list

On Friday, Aug 30, 2002, at 13:25 US/Pacific, Jeffrey Palmer wrote:
> On Friday 30 August 2002 01:02 pm, Alessandro Baretta wrote:
>>
>> I propose to add an optional namespace construct to
>> explicitly associate namespace URIs with namespace names.
>
> Please, let's not entertain any of the rampant stupidity that the W3C 
> seems so
> mired in. I've always thought that the concept of using URIs for 
> namespaces,
> parameter settings, etc., was the most ridiculous thing I've ever 
> seen. [...]

A more constructive way to say this might be to observe that any syntax 
for a global namespace of Objective Caml types and values could be 
transformed into a URN by simply publishing an Internet RFC that 
defined the syntax for the namespace specific string, according to the 
requirements of RFC 2141.

It would seem desirable to choose a namespace syntax that lends itself 
easily to encoding in a URN.

Here's another strawman for discussion.

-----

The obvious choice for a namespace identifier is "ocaml" and this would 
produce URN's of the following form:

	<urn:ocaml:some:hierarchy:YourModuleHere.your_type_or_value>

I chose a ':' character to separate levels in the namespace hierarchy 
arbitrarily.  Other characters like '/' or '.' could easily be 
considered as well.

In this example, you could imagine that the compiler could be invoked 
with a namespace flag, like so:

	ocamlc -N :some:hierarchy -c yourModuleHere.ml -o yourModuleHere.cmo

You could then define a language construct that looks kinda like the 
following:

	namespace N = :some:hierarchy
	module M = N:YourModuleHere

The 'namespace' keyword would define an alias for a prefix to the 
modules in some part of the global namespace, and it would be used in a 
straightforward way as shown above to construct the names of externally 
defined module types.

The namespace would be encoded in the .cmi and .cmo files, and the tool 
chain would need to respect them as it searched for signatures and 
modules to reference.


-- 
j h woodyatt <jhw@wetware.com>
markets are only free to the people who own them.

-------------------
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] 8+ messages in thread

* Re: [Caml-list] Namespace proposal: XML variant
  2002-08-30 20:25     ` Jeffrey Palmer
  2002-08-30 22:39       ` james woodyatt
@ 2002-08-30 22:51       ` Blair Zajac
  1 sibling, 0 replies; 8+ messages in thread
From: Blair Zajac @ 2002-08-30 22:51 UTC (permalink / raw)
  To: Jeffrey Palmer; +Cc: caml-list

Jeffrey Palmer wrote:
> 
> On Friday 30 August 2002 01:02 pm, Alessandro Baretta wrote:
> > I thoroughly dislike any "package ~= directory" solution,
> > yet I think a namespace construct should be present in the
> > language in order to allow interoperability between
> > different projects with different naming conventions. I
> > propose a scheme à la XML, where namespaces are URIs
> > belonging to the person or organization which releases the
> > associated code.
> >
> > I propose to add an optional namespace construct to
> > explicitly associate namespace URIs with namespace names.
> >
> > namespace MyBigProject = "http://alexbaretta.com/big_project/"
> >
> >
> 
> Eeek!
> 
> Please, let's not entertain any of the rampant stupidity that the W3C seems so
> mired in. I've always thought that the concept of using URIs for namespaces,
> parameter settings, etc., was the most ridiculous thing I've ever seen. I
> mean, let's be honest here - HTTP is a network _protocol_, and it has nothing
> to do with anything namespace or parameter related. The thing that really
> irks me about the whole scheme is that most of the time these aren't even
> _valid_ URIs (i.e., inaccessible).
> 
> I'm all for a hierarchical namespace that's not related to the filesystem (In
> Java it always ended up causing headaches for large projects - compilers that
> "intelligently" put your compiled code in the correct package directory,
> etc.). It seems that the question of segmenting libraries according to
> directory should be a decision that's left up to the implementor, as it is
> currently.
> 
> All of this is, of course, my own opinion, so take it with the corresponding
> pinch of salt.
> 
> Cheers,

Tag URI may be a good choice.

http://www.taguri.org/

    The tag algorithm lets people create character strings which no
    one else using the same algorithm could ever create. It is simple
    enough to do in your head, and the resulting strings can be easy
    to read, write, and remember. You can use the strings wherever
    you need a unique identifier conforming to the URI (URL) Syntax 

They look like this:

    tag:sandro@world.std.org,2001-06-05:Taiko

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
-------------------
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] 8+ messages in thread

end of thread, other threads:[~2002-08-30 22:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-15 16:21 [Caml-list] Namespace proposal Gurr, David (MED, self)
2002-08-15 17:00 ` Vitaly Lugovsky
2002-08-15 21:08   ` [Caml-list] " Michaël Grünewald
2002-08-18 17:05 ` [Caml-list] " John Max Skaller
2002-08-30 18:02   ` [Caml-list] Namespace proposal: XML variant Alessandro Baretta
2002-08-30 20:25     ` Jeffrey Palmer
2002-08-30 22:39       ` james woodyatt
2002-08-30 22:51       ` Blair Zajac

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