[self-interest] Self versus classes
Jecel Assumpcao Jr
jecel at merlintec.com
Thu Mar 15 01:37:39 UTC 2001
On Tuesday 13 March 2001 13:23, Albertina Lourenci wrote:
> I am preparing to submit a paper to OOPSLA'01 about an
> hermeneutic understanding of Object oriented programming.
> Last OOPLA, Rayside and Campbell proposed An Aristotelian
> understanding of object-oriented programming.
> It is based on Aristotelian logic.
I think that the Plato versus Aristoteles debate in programming dates
at least from the mid 1980s.
> It seems to me that the computer scientists have difficulty
> in truly grasping the thingness of the things that can be
> very well expressed in OO paradigm.
Most computer scientists have a pure mathematical background or
inclination. Alan Kay divided his time between mathematics and
molecular biology. That problably helped...
> Hence they insist on focussing the class concept as central in
> OO programming.
It was a key concept in Simula and Smalltalk. Most languages that
followed them just took classes for granted, specially since they fit
in so well with abstract data types (ADT) that everyone was worried
about in the late 1970s.
> I will take for granted this to ease the discussion. Of course
> my opinion is that the object is the central concept.
It is called "object oriented programming", after all, and not class
oriented programming. Classic programming, perhaps?
> So I would like Mario to join the discussion. I have reread his
> nice paper about self includes:Smalltalk.
> He implemented in a direct and straightforward way Smalltalk
> in Self in three weeks.
> The point here is that to exploit Self's possibility of let's
> say translating a language into it, in my opinion is not the
> same as stating that we can simulate in Self efficiently and
> safely like in C++, Simula or Eiffel the class concept.
Please note the paper's title: "Self includes: Smalltalk". The whole
point was to prove that Self is a valid dialect of Smalltalk. Self was
designed by starting out with Smalltalk and eliminating many
distinctions (inheritance versus instanciation, instance variables
versus global variables, object cloning versus method activations and
so on). Some people thought that with all these simplifications Self
might have become less than Smalltalk. Mario showed that just adding a
few support objects and a parser (since there are slight syntax
differences) full compatibility with Smalltalk-80 was obtained.
A very different effort was Pep, which translated Java bytecodes into
Self bytecodes. This just made use of the virtual machine (much as
several languages have made use of Java's virtual machine) and not
really the Self language itself. Nobody would argue that Self is a kind
of Java :-)
Of course, you can implement nearly any language in nearly any other
language. That just proves that computers, and languages, are universal
machines. But writing a Lisp interpreter or compiler in C says very
little about the relationships between those two languages.
But Mario didn't implement a Smalltalk interpreter or compiler in Self.
He didn't even just use the Self virtual machine to run translated
Smalltalk code (though it did that). He made use of Self's boolean and
integer objects among others. The new Smalltalk objects *looked* like
Self objects and could be used as such.
This effort did prove that the full semantics of classes, as
implemented in Smalltalk, are available in Self. C++ or Eiffel classes
are another story.
> Suppose the user wants to implement in Self the classification
> of the families, genera and species. Is Self fit to do this?
Sure: make genera objects the parents of species objects, and the
family objects the parents of genera objects.
flipper = ( | species* = tursiops.
age <- 3.
tursiops = ( | genera* = truncatus.
popularName = 'bottle-nosed dolphin'.
color = paint named: 'gray'.
truncatus = ( | family* = delphinidae.
delphinidea = ( | suborder* = odontoceti.
odontoceti = ( | order* = cetacea.
spiracles = 1.
hasTeeth = true.
cetacea = ( | infraclass* = euthenia.
forwardLimbs = paddles.
rearLimbs = false.
euthenia = ( | subclass* = thenia.
placental = true.
thenia = ( | class* = mammalia.
eggLaying = false.
I don't think this could be done any better in another language, and
would actually be worse in many of them.
> If so why then computer scientists even enjoying and loving Self
> have difficulties to understand it and program in it?
Not many people have ever seen a running Self system. I don't think
that those who have had problems understanding it or tried to program
in Self and failed. If that is the case for anyone on this list, please
speak up so we can find out what is wrong.
I have seen many people who have read a few of the papers and didn't
get what it is all about, but that is an entirely different matter.
More information about the Self-interest