Path: utzoo!utgpu!attcan!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond From: diamond@csl.sony.JUNET (Norman Diamond) Newsgroups: comp.lang.smalltalk Subject: Re: Smalltalk versus C++ Keywords: object-oriented languages Message-ID: <10097@socslgw.csl.sony.JUNET> Date: 6 Jan 89 04:24:23 GMT References: <447@ubbpc.UUCP> Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 49 In article <447@ubbpc.UUCP>, wgh@ubbpc.UUCP (William G. Hutchison) writes: > From my reading, it appears that > (1) Smalltalk can create classes dynamically, whereas C++ does it at > compile time; Smalltalk is based on an interpreter, and the standard system includes interfaces to the "compiler" (which translates source to pseudo-codes that may be interpreted), so classes and everything else may be created dynamically. The same could be done theoretically in any language, but has not been done in most languages because efficiency has usually been considered more important. > (2) In Smalltalk "everything is an object" whereas C++ treats the traditional > C data types differently from programmer-defined objects; Smalltalk requires "everything" to be accessed as an object, through an interface defined in a class. However, the interpreter really knows that some primitive data types have to be implemented differently, and you can get in trouble if you don't attach grains of salt where necessary. (Just use traditional data types for their traditional purposes and you won't get in trouble.) > (3) Smalltalk has multiple inheritance, but C++ does not yet (shortly, I am > informed); Both languages have multiple inheritance in implementations, though the manuals for both languages deny it. > (4) Smalltalk may be designed in a way such that it has built-in overhead, > and it may never be possible to make Smalltalk programs run as fast as > C++ on present-day machine architectures (not sure about this, so I > thought I would ask). Huh? ANY language "may be designed in a way such that it has built-in overhead." Any implementation may do so too. Perhaps you mean that Smalltalk MUST be implemented in such a way -- that is why Smalltalk programs cannot run as fast as C++ programs potentially can (usually). Yes, that is true. That is why interpretive implementations of any language are less popular than compiler-based languages and compiler implementations. Are your programs CPU-intensive, real-time, etc.? If not, Smalltalk's speed may be quite sufficient. It depends on your applications. -- Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net) The above opinions are my own. | Why are programmers criticized for If they're also your opinions, | re-inventing the wheel, when car you're infringing my copyright. | manufacturers are praised for it?