[Haskell] URLs in haskell module namespace
Graham Klyne
GK at ninebynine.org
Tue Mar 22 06:49:42 EST 2005
At 15:47 21/03/05 -0500, S. Alexander Jacobson wrote:
>As I move from machine to machine, it would be nice not to have to install
>all the libraries I use over and over again. I'd like to be able to do
>something like this:
>
> import http://module.org/someLib as someLib
>
>If the requested module itself does local imports, the implementation
>would first try to resolve the names on the client machine and otherwise
>make requests along remote relative paths.
I think this is an interesting idea, that has some interesting implications
for possible evolution of Haskell as an integrated "scripting language" for
the web. One of the principles of web architecture is, roughly, that
anything worth naming is worth naming with a URI [1][2].
I think a logical consequence of using URIs for module names is that module
exports can become URI references with fragment identifiers. Thus, given:
module http://example.org/modules/foo( func1, func2, val3 ) where ...
Also introduces URI references:
http://example.org/modules/foo#func1
http://example.org/modules/foo#func2
http://example.org/modules/foo#val3
This exactly where web services and SOAP are going, using URIs to identify
processing services in the Web.
Some other points to note...
Concerning dependency on http: http: is just one URI scheme among
many. It just happens to be very widely used, and provides a uniform
naming and resource location framework [3] [6].
Within the Web technical community, there is a strong sense that *all* URIs
should be stable [4] [5], or breakage occurs. This is illustrated by the
concern for dependence on changeable URIs expressed in another message in
this thread, but I think that when persistence is needed (for technical
reasons) then it can be arranged.
#g
--
[1] http://www.w3.org/TR/webarch/#uri-benefits
[2] http://www.w3.org/DesignIssues/Webize.html
[3] http://www.w3.org/2002/Talks/www2002-tbl/
http://www.w3.org/2002/Talks/www2002-tbl/slide12-0.html
(I spent a little while looking for a more definitive view on this idea of
the less-than-absolute distinction between identification and location in
the web. Although this topic is much-discussed in web circles, this was
the best I could find quickly.)
[4] http://www.w3.org/Provider/Style/URI
[5] http://www.w3.org/DesignIssues/PersistentDomains
[6] http://www.w3.org/DesignIssues/Naming
------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact
More information about the Haskell
mailing list