[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why would anyone want opacity?

From: Gerald Jay Sussman <gjs@martigny.ai.mit.edu>
Subject: Why would anyone want opacity?
Date: Thu, 9 May 96 15:38:03 -0400

> I don't see how ENFORCEMENT of a restriction, such as strong typing,
> has anything to do with thinking.  ENFORCEMENT is a management tool.
> I have no objection to optional mechanisms that advise or warn you
> that you are violating some restriction that you want to impose on
> yourself to aid your thinking, but I strongly object to you REQUIRING
> me to abide by your intellectual crutches.  I would not impose my
> crutches on you!

Most garbage collected languages, including Scheme, enforce a policy,
where pointers are opaque, i.e., we can't get at the actual bits of a
pointer.  This is a restriction, the purpose of which is to free us
from the burden of having to deal with certain aspects of memory
management explicitly, thereby freeing brain capacity and making it
available for use by more interesting activities.

However, it *is* a restriction, an abstraction, an intellectual
crutch.  And so are: virtual memory, file handles, processes, you name
it...  Do you reject all those as well, because you don't like them to
be ``imposed'' on you?

Now, you might argue that types do not give you similar benefits, and
therefore you don't like them.  For me, and I suppose for many of the
other folks who came to like them, types are a restriction, the
purpose of which is to free us from certain aspects of managing
semantic correctness.  This also frees brain capacity, thereby helping
us focus on the more important aspects of program design.

I know, you think that types are actually hindering you in your design
efforts.  Apparently, different people think differently, because I
found that often there is a remarkable coincidence between ``getting
the design right'' and ``getting the types right''.

Nobody claims that type systems *guarantee* semantic correctness --
just like GC cannot guarantee the absence of memory leaks.  But both
of them help, both of them are intellectual crutches.  You just reject
one kind of crutch -- why not go all the way then?