Subject: Re: [SWIPL] libraries written in Prolog

From: Paul Singleton <[email-masked]>
Date: Fri, 25 May 2001 22:11:20 +0100

Jan Wielemaker wrote:

> P.s.    In a wider context I'm a bit worried on these issues.  Using
>         file_search_path/2 is a great way to organise the file-structure,

For development maybe, but for deployment I think a PATH in the inherited
environment would be better.  Isn't there a chicken/egg situation with
regard to getting file_search_path/2 clauses into the files you're trying
to find?!

>         but the module name-space and public predicate namespaces are
>         flat.

I guess it's too late to do anything about this? but we could adopt a
convention for constructing module names like Java packages?

>         If we just keep adding modules to the library, eventually it
>         will become unmanagable.

I just about cope with 23k procs in 700 libraries, and I don't yet use
modules :-)

> I'm seeking for solutions that
>         preferably fit with some kind of standard.

I suggest we learn whatever we can from the practical success or otherwise
of the corresponding design decisions that were made for Java.

Really, I don't believe in modules.  All we need is a system for naming
predicates, e.g.

  nl_uva_psy_swi_table_util_sort_table(...)

and a smart editor which, within a context of:

  this module is called 'nl_uva_psy_swi_table_util'

  and it uses predicates from
        'nl_uva_psy_swi_table'
        ...

allows us to use relative names, then absolutifies them.

Actually, we'd need a whole suite of tools which conspired to hide
the long-winded absolute nature of all the names.

NB I reckon scalability (without the 'e' this time) of data types and
constructors is a much worse problem, but I'm still getting my thoughts
together on this (I want implementation inheritance, polymorphism,
substitutability etc.)

Paul Singleton