[comp.lang.pascal] need info on C++ vs Object Pascal vs Objective C vs etc

code@sphinx.UUCP (06/29/87)

I am interested in hearing about the relative merits of object oriented
programming languages.  I am especially interested in languages that are
faster than Smalltalk but relatively standard.

(Please forgive if some of this redunds with a previous posting.  Our computer
was off the net for a while, and I never saw a response.  I am not sure my
previous posting went out at all.)

Some of my concerns:

  1) C++ seems unnecessarily arcane to me.  It seems to me to be too much
like C (terse, unfriendly, really-low-level) in the ways I prefer Pascal
(idealized).  I would like to be able to truly dynamically bind methods
in a straightforward way.  (Please, no C-vs-Pascal flames.  I recognize
many strengths of C, but they're not as critical to me as to many others.)

  2) Is Object Pascal good?  Is it available (or will it be soon) for
machines other than the Macs?  Will it become a standard, or will it remain
an Apple oddity?

  3) Is anyone developing an interpreter for C++?  This seems like the way
for C++ to go, if possible.  (Then it might never be necessary to write a
true C++ compiler.  You could develop in an interpreter, and endure slow
translation-compilation when you were pretty much finished.)  Would it be
particularly hard for somebody to write a C++ interpreter?

  4) How much momentum is there behind these languages (and others, like
Objective-C)?  Is it time to get with it, or time to wait and see?  I am
looking for a popular, portable language.

  5) How is Actor doing?  Is it available for Mac's?

  6) Has anybody used Little Smalltalk?  Any reactions?

  7) Are there any emerging standard interfaces between o-o languages and X?

  8) Has anybody got a decently fast o-o lisp with real-time (e.g. incremental)
     or near-real-time garbage collection?


Please respond directly to me at the e-mail address below (do not trust
header addresses).  I'll summarize to the net if there's interest expressed.
Thanks,
| Paul R. Wilson       ph.: (312) 947-0740      uucp: ...!ihnp4!uicbert!wilson |
| Electronic Mind Control* Lab     if no answer: ...ihnp4!gargoyle!sphinx!code |
| UIC EECS Dept. (M/C 154)               arpa: uicbert!wilson@uxc.cso.uiuc.edu |
| P.O.Box 4348   Chicago,IL 60680   (*a.k.a. Human-Computer Interaction)       |

shopiro@alice.UUCP (06/30/87)

In article <2016@sphinx.uchicago.edu>, code@sphinx.UUCP writes:
> I am interested in hearing about the relative merits of object oriented
> programming languages.  I am especially interested in languages that are
> faster than Smalltalk but relatively standard.

I have been working with C++ for the past several years.  C++ is an
object oriented language designed for people who would otherwise use
C, but need more support for managing complexity, as well as a
language for people who would otherwise use Smalltalk, but need a
language that is faster and more portable (and also has the advantages
of a compile-time type system).  C++ is a nearly upward compatible
extension of C, is available for a wide variety of machines under
MS-DOS, UNIX, VMS, and other operating systems, and is in use at many
(that is, thousands of) academic and commercial sites.

> Some of my concerns:
> 
>   1) C++ seems unnecessarily arcane to me.  It seems to me to be too much
> like C (terse, unfriendly, really-low-level) in the ways I prefer Pascal
> (idealized).  (Please, no C-vs-Pascal flames.  I recognize
> many strengths of C, but they're not as critical to me as to many others.)

Although some people view the terse syntax of C as a deficiency,
we like it.  You may also find that some of C's ``low levelness''
has been mitigated by C++'s much stronger type checking.

I'm not quite sure what you mean by unfriendly, but C++ programs
can be much more declarative (as opposed to procedural) than C
programs, and the compiler does a quite thorough consistency check,
generating much better error messages than C.  This helps a lot.

C++ supports a wide range of programming styles, including the low
level code that is typical of carefully tuned C programs.  This is
essential for some;  you might prefer the data abstraction and object
oriented styles that better utilize the C++ type system.

> I would like to be able to truly dynamically bind methods
> in a straightforward way.

If you mean that you would like to dynamically link procedures into a
running program, that is not implemented in the generally available
implementations of C++.  On the other hand, C++ supports the invocation
of methods based on the (dynamically determined) type of the object
very well.  The syntax looks like C, the semantics is what you would
expect (no surprises), and the cost of a method invocation is equal
to the cost of an ordinary function call plus four memory references.

>   2) Is Object Pascal good?

I don't really have an opinion.  It is Pascal.  It runs on a Mac.
It provides support for object-oriented programming (methods),
but not for data abstraction (data hiding, operator overloading,
etc.).  It is simpler than C++, but then it isn't used for such a
large range of applications on such a large range of systems as C++.

> Is it available (or will it be soon) for machines other than the Macs?  Will
> it become a standard, or will it remain an Apple oddity?

For what it is worth I can mention that Apple is adopting a subset of C++
called ``minimal C++'' as their C and that they are re-writing MacApp
in C++.  For details, ask Larry Tesler at Apple.

>   3) Is anyone developing an interpreter for C++?  This seems like the way
> for C++ to go, if possible.  (Then it might never be necessary to write a
> true C++ compiler.

Don't underestimate the C++ to C translator;  it does a complete type
check and uses a C compiler only as a code generator - it is not a
simple preprocessor.  However, AT&T does have a ``true compiler'' that
produces assembler or object code for several machines without going
through intermediate C.  Others are producing such compilers too;  next
year you will have several (compatible) choices.

> You could develop in an interpreter, and endure slow
> translation-compilation when you were pretty much finished.)  Would it be
> particularly hard for somebody to write a C++ interpreter?

C++ programs tend to be largely declarative, and a small change in a
declaration can have pervasive effects on the code.  I think it would
be quite difficult to write a fast C++ interpreter, although I would
be glad to be proved wrong.  The way things are going seems be towards
incremntal compilation that combines fast turn-around for debugging
with strong type checking.

>   4) How much momentum is there behind these languages (and others, like
> Objective-C)?  Is it time to get with it, or time to wait and see?  I am
> looking for a popular, portable language.

C++ is certainly popular and portable.  C++ is widely used both within
and outside AT&T, and there is C++ development both within and outside
AT&T.  Some I can't talk about and most I don't know about.  The number
of projects must be in the thousands now.  C++ will continue to improve
in an upward compatible way, but if you are looking for an object
oriented language to use now, and if portability or performance
matters, I think C++ is the way to go.

>   7) Are there any emerging standard interfaces between o-o languages and X?

Using C libraries from C++ is quite straightforward.  There certainly
are people using things such as Xwindows and Microsoft windows from C++.
There are no standards as yet.

What have you read about C++?  The C++ book?  Papers?  If you are interested
I could send you a few recent papers.
-- 
		Jonathan Shopiro
		AT&T Bell Laboratories, Murray Hill, NJ  07974
		research!shopiro   (201) 582-4179

dgold@apple.UUCP (David Goldsmith) (07/02/87)

In article <7037@alice.UUCP> shopiro@alice.UUCP writes:
>>   2) Is Object Pascal good?
>
>I don't really have an opinion.  It is Pascal.  It runs on a Mac.
>It provides support for object-oriented programming (methods),
>but not for data abstraction (data hiding, operator overloading,
>etc.).  It is simpler than C++, but then it isn't used for such a
>large range of applications on such a large range of systems as C++.
>
>> Is it available (or will it be soon) for machines other than the Macs?  Will
>> it become a standard, or will it remain an Apple oddity?
>
>For what it is worth I can mention that Apple is adopting a subset of C++
>called ``minimal C++'' as their C and that they are re-writing MacApp
>in C++.  For details, ask Larry Tesler at Apple.

We are producing a version of C++, and you will be able to access MacApp
from it, but MacApp itself will remain in Object Pascal.

Just for fun, I thought I'd mention the one big remaining objection I have to
C which isn't fixed by C++: the inability to use closures.  By this I mean
the facility which is provided by blocks in SmallTalk, LAMBDA in LISP, and
nested procedures in Pascal.  This allows you to encapsulate a bit of code
with the current lexical scope and pass it to another procedure.  We use
this capability of Pascal heavily in MacApp and its lack in C++ makes use
of MacApp a little akward.  I remember the original "Block Structure is
for The Birds" paper, but I think this is one use of nested scope which the
designers of C missed.  It would be nice if there were some way to do it
in C++.  The code you pass is basically a procedure, but it doesn't have
to have a name (nested procedures in Pascal do, but SmallTalk blocks and
Lisp lambdas don't).
-- 
David Goldsmith
Apple Computer, Inc.

AppleLink: GOLDSMITH1
UUCP:  {nsc,dual,sun,voder,ucbvax!mtxinu}!apple!dgold
CSNET: dgold@apple.CSNET, dgold%apple@CSNET-RELAY
BIX: dgoldsmith