Interfaces - the next step

Squeak at OCIT squeak at ocit.com
Tue Jul 20 16:04:07 UTC 1999


Peter:

Just quickly two things:

I guess to me the most useful aspect of interfaces is at the design level
i.e. I will agree that the notion of interfaces and "type" are basically
the same.  To me it is important to know who implements for example the
"addressable" interface because to me "addressable" is a type of thing .  I
will also agree that the essence of an interface is that it guarantees at
least that those objects that implement the interface will understand the
specific protocols in question (at least syntactically). I will dare say
that from an implementation perspective I might not care if said guarantee
is enforced . After all , it will crash and I quickly will be aware that I
forgot to fulfill the contract. Would it be nice? Yes, if I did not have to
do anything too disgusting. That's why SmallInterfaces do provide enough
utility to make them nice yet not painful.

My personal theory on "typing" as I understand them from excursions into
Java land and C++ is that they are really there to help out with overall
"system" things. They may make compiling easier , vm optimizations easier,
perhaps integrating with other code packages easier, I'm not sure. Yet in
order to accomplish these things the language designers have plagued the
lives of us developers by forcing us to litter our code not to our
immediate benefit, making extensibility relatively nightmarish to what one
can accomplish with Smalltalk.

I'll admit that I'm out of my league at the present with regards to the
topic of language design but I do like the notion of 
stripping these system concerns from day to day code into overall system
constructs such as what I understand are proposed by Aspect Oriented
Programming. 

Well, I guess that wasn't too quick.

Later,

Charles

At 04:22 PM 7/20/99 +0930, you wrote:
>
>From: Squeak at OCIT <squeak at ocit.com>
>
>
>>Peter:
>>
>>You stated:
>>
>>>How can you make a safe design if there is no guarantee that objects
>>>implementing the interfaces can actually communicate with each other?
>>
>>I can appreciate what you are saying yet this notion of safety is still
>>from a practical perspective to me quite confusing.
>>I have been delivering ST apps for quite a while now and I can't think of
>>one situation where I could not live with being not as safe as I quess
>>things could be.
>>
>>When does "safety" become a "practical" problem. Perhaps more in certain
>>domains?
>
>>
>>My problem with this entire issue is that all of this leads most usually
>>with people concluding that we need typing in Smalltalk and I personally
>>don't want to deal with it.  I have also heard some people argue that one
>>can't use ST in this or that because it is not safe. I'm not sure if I can
>>agree with this.
>
>
>I think you have hit the nail on the head. While type systems may be
>provably 'safer' and lend themselves to mathematical analyses - in the real
>world, very few systems are produced in this way. I have programmed with
>types in Pascal, and always seemed to be looking for novel ways to bypass
>the type system. The fact that many typed languages require 'casts' to work
>around typing problems seems to indicate that the system is far from
>perfect. I guess interfaces are a form of typing. Whereas types are often
>thought of as classes (in C++), this is far too restricting, and that is
>where interfaces come in. Strongtalk was (is?) a typing system for
>Smalltalk. The fact that it never caught on is interesting, and suggests
>typing may not be as necessary as proponents of other languages think.
>
>While I personally like the freedom of dynamic typing, I think Interfaces
>present a different context. To me, the whole reason for an Interface in the
>first place is to guarantee (syntactic, if not semantic - thanks for
>pointing that out, Lex) compatibility between two or more objects. If you
>use interfaces for other things, I would be interested in hearing about
>them. When you say that you havent come across any real situations where you
>need the absolute safety of types, I believe you, but then those situations
>probably don't require interfaces either. Ultimately, the notion of
>'interface' and 'type' are very closely tied together (they are probably
>different words for the same thing)
>
>The nicest type system I have come across is Haskell, where the compiler
>does type inferencing. This is almost completely transparent (unless you
>create a typing error), yet is a very robust system.
>
>Peter
> 





More information about the Squeak-dev mailing list