[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
contours, locales and modules.
I agree with you in general about the need for a concept of modules,
but I have to say that I think you are being overly critical of Hal
and Gerry. I agree that what they did didn't address the problem at
the right level; contours aren't really the right solution. However,
I noticed that your "modules solution" note was exactly the same!
You, too, were using contours to solve this problem.
I think that the right track, which Gerry Sussman described to me, is
to think of code as black boxes with connection points. Now, in
Scheme, variables are the connection points, and environments are the
wires used to connect them together. However, environments aren't
adequate because they restrict the means of combination too sharply.
On the other hand, all of the other systems I have seen don't really
embody this model either. Common Lisp, in particular, has a model
which is adequate for many problems, but which is much too clumsy for
use on the micro level of programming (i.e. inside a small procedure).
And other models I have seen suffer from describing the connectivity
procedurally, which is too explicit.
What I would like to see is a DECLARATIVE mechanism which describes
directly the connectivity of a program. Given some packages, one
could then declare relations between the free variables in one package
and the defined variables in another. But the description of the
relationship between the packages should be separate from the
descriptions of the packages themselves.
I think such a mechanism would be adequate at both the micro and macro
level of programming, since, being declarative, it says very little
about the implementation. A compiler could implement the connections
differently in different circumstances.
Sadly, I can't imagine how such a thing could be efficiently
implemented. But it is the kind of behaviour that I would like.