[clean-list] Comments on the module system
Marco Kesseler
m.wittebrood@mailbox.kun.nl
Thu, 25 Jul 2002 21:13:02 +0200
>> > One of the things that's (sorely, IMO) missing from the Clean module
>> >system is qualified names, where you refer to the identifiers in a module
>> >using ModuleName.identifier or some equivalent syntax.
>> >
>> > Another issue that I've mentioned is the lack of hierarchy. Even
>> >rather pathetic (compared to Clean) languages like Java have hierarchical
>> >namespaces and I think it's a good idea.
>>
>> In principle I agree that it is a good idea to have namespaces of
>> some sort,
>> but I seriously doubt whether namespaces should be related to module
>> names
>> and module hierarchy. This will lead to trouble when one starts
>> rearanging modules.
>
>If you mean that hierarchical namespaces shouldn't map to filesystem
>directory
>hierarchy, I agree. However, I think modules should define scopes. Think of
>the ML module system without functors, or Ada packages without generics.
>Mercury, which is a kind of cousin to Clean, is a good source of design
>ideas here (though I prefer separate interface and implementation modules
>like Clean and Ada).
Modules already define scopes, in the public/private sense, but I
would not couple this to namespaces.
I am not too familiar with the ML, Ada and Mercury solution. However,
I think
that it would be useful to add definitions to a particular namespace
without
having to add it to a particular module.
Consider for example the case that one wants to extend some
'standard' namespace with new definitions. In such a case it is
probably unwise to
touch the original implementation modules, even if one does have the
sources.
Furthermore, in a system of reasonable size, there will often be a lot
of modules, which makes it hard for a programmmer to find out in which
module a particular definition resides. A library of a particular party
will usually have no conflicting names. These could all be placed in a
single namespace, which is quite convenient, and easy to remember.
But maybe I am overlooking something?
regards,
Marco