[net.lang] Object oriented

brownell@harvard.ARPA (Dave Brownell) (06/22/84)

Shees!!  This discussion should be in harvard.last-years-am110 or a
fireplace or /dev/null or something like that.  Or maybe USENET should
be checked out by the synth-fuels program as a source of alternate
energy ... I pray that nobody finds my flaming as offensive as I find
the recent flames by 'munyer@harvard'.

Seriously, at this point it reminds me of an episode in a programming
languages seminar that I learned a lot from.  It was a fun course with
a very relaxed atmosphere, much bull exchanged but we all loved it.  I 
as flaming away one afternoon, and said something omniscient like
"programming languages are designed to express ideas".

My professor stopped me on that one, and said that this was a very
serious misconception.  "Programming languages," quoth he, "are ways of
telling the computer WHAT TO DO."  It seemed at the time to be a very
minor point, but it's grown on me with time.

The idea was that any language that keeps the computer from doing
its job is no good.  The SCHEME implementation we used last year fell
into that category, there can be no equivocation on that fact.

<<< fanning the flames from here on >>>


This is the essence of the C v. SCHEME debate (what a silly topic).
You can write programs in C and your computer will be able to perform.
You can't do that with a SCHEME program, or a T program, or a LISP
program, or a PROLOG program.  The latter languages are not for use in
production software.  They're too expensive now to use in any serious
fashion outside of research environments.  Do you wonder why so much
current effort in AI circles is to get good LISP chips?  or to get good
PROLOG chips??  (In prolog's case, there is still significant language
design to be done ... logic programming is a different programming
paradigm.  It's not yet free of imperative details.)  Show me an
operating system written in LISP that will support a hundred users,
and I'll beat a path to your door.

I would note that object-oriented programming is only ONE model of
abstraction, and isn't the most accepted one.  It would be accepted
more if there were implementations that performed as well as the
others.  Take abstract data typing, for example ... CLU works OK from
what I've heard.  The whole goal of ADA's type system (which has been
maligned in this place too) is to create a STATIC system of types.  So
long as you have a DYNAMIC type system (like SCHEME) you're in very
deep trouble.  I was very disappointed to find out that the comiler for
T was incapable of discerning a statically typed program, and
eliminating runtime checking.

Lest I be mistaken, I DO like the AI languages.  I'd never have
designed a Prolog compiler if I wasn't fascinated by logic programming,
or taught the course of two years ago if I hadn't thought that the
SCHEME based course had the highest potential for teaching of concepts
that I'd seen.

Just ... please don't anybody go around touting AI languages as general
purpose, and please don't go flaming that a language as revolutionary
as C is antiquated yet, or is unusable.

Yes, revolutionary!!  I have seen the software industry, and it is
on fire.

I've got to stop this late night flaming ... it's making me sleep like
a student again.  Wake me up for dinner.



Dave Brownell
{allegra,floyd,ihnp4,seismo}!harvard!brownell

barmar@mit-eddie.UUCP (Barry Margolin) (06/22/84)

In response to harvard!brownell, one of the most elegant, well-designed,
and well-written operating systems I have encountered is written
entirely in Lisp.  I am referring, of course, to the Lisp Machines
invented at MIT, and now being sold commercially by Symbolics, Inc., and
Lisp Machines, Inc. (note that I work for neither of these, although I
have friends working at both).  The Lisp Machine supports multi-tasking,
networking, and one of the best window systems in existence.  The use of
the Flavor type system, which was initially invented as part of the
reimplementation of the Lisp Machine window system about four years ago,
simplifies many of the problems in systems programming.  For instance,
about two years ago they implemented a condition-signalling paradigm
in which conditions are flavor instances: this allows one to say that a
particular type of condition is an combination of several different other
types (e.g. DIVIDE-BY-ZERO has the attributes of NUMERIC-ERROR,
INVALID-ARGUMENT, HARDWARE-FAULT, etc.), and condition handlers may be
set up that catch either specific or general conditions (in this case,
if there is no handler for DIVIDE-BY-ZERO, but there is a handler for
NUMERIC-ERROR, the latter will catch a DIVIDE-BY-ZERO error).

Now, before someone castigates me: I realize that it is probably
possible to implement these things in any modern HLL.  However, the
object-oriented Lisp environment simplifies things an amazing amount.

What is it about object-oriented languages that makes them so much
better?  It is the fact that they make it easy to mirror the real world
in the programming language.  This simplifies the design of programs,
and also simplify the understanding of the programs.  A Lisp-like
language with heap-based storage and garbage-collection removes the need
for the programmer to worry about bookkeeping, allowing him to work on
the important parts of the program.  I work mostly in PL/I, and many of
the obscure bugs have to do with stupid things like attempting to free a
structure twice, or freeing a structure that is referenced in another
structure.  In the real world you don't worry about who knows about
something; if someone knows about it, that's fine, and if no one knows
about it then it doesn't exist.  The real world is a huge heap of atoms
that can be put into relationships with each other,
and the Lisp world is a huge heap of conses that can be put into
relationships with each other.

I hadn't intended to write such a long article, but now that I'm sort-of
done, I'm glad.
-- 
			Barry Margolin
			ARPA: barmar@MIT-Multics
			UUCP: ..!genrad!mit-eddie!barmar

nessus@mit-eddie.UUCP (Doug Alan) (06/22/84)

()

>	From: brownell@harvard.ARPA (Dave Brownell)

>	I pray that nobody finds my flaming as offensive as I find
>	the recent flames by 'munyer@harvard'.

I don't find the flaming by Robert Munyer offensive at all.  In fact I
think he is completely right.  He deserves the
Most-Reasonable-Person-Besides-Me-on-the-Net-of-the-Day award.  Your
flaming, on the other hand, I find incredibly bogus.

>	I was flaming away one afternoon, and said something omniscient
>	like "programming languages are designed to express ideas".

>	My professor stopped me on that one, and said that this was a
>	very serious misconception.  "Programming languages," quoth he,
>	"are ways of telling the computer WHAT TO DO."  It seemed at the
>	time to be a very minor point, but it's grown on me with time.

You were both wrong.  Programming languages are both to express ideas
AND to tell the computer what to do.  Any programming language that
ignores either one of these is seriously deficient.

>	You can write programs in C and your computer will be able to
>	perform.  You can't do that with a SCHEME program, or a T
>	program, or a LISP program, or a PROLOG program.  The latter
>	languages are not for use in production software.  They're too
>	expensive now to use in any serious fashion outside of research
>	environments.

That's not true at all.  It just takes a bit of work to do an efficient
implementation, but it's worth the work.  It is fairly easy to do a
proof by example.  Programs written in MacLisp on a Decsystem-20 run
faster than programs written in Algol.  Lisp Machine Lisp: a simple
program to calculate 1000 factorial only takes a second to run.  CLU
(which is object-oriented with the exception that there is no run-time
type polymorphism in case to you "object-oriented" means the Smalltalk
notion) on a Decsystem-20 and on Berkely Unix generates excellent code:
TED, written in CLU, is faster than CCA Emacs which is written in C.

With computer hardware becoming cheaper all the time and with programs
constatntly becoming larger and more complicated, the cost of developing
and maintaining programs will soon be much more of a concern than the
cost of the hardware.  Those who do not start using languages that let
them concentrate on the important parts of the problem instead of making
them worry about details that the computer should be worrying about and
that adequately support modularity through data abstraction, etc. are
soon going to be left behind in the dust.

>	Show me an operating system written in LISP that will support a
>	hundred users, and I'll beat a path to your door.

Who cares.  Mainframes are dinosaurs.  Personal computers and
distributed computing are the future.
-- 
				-Doug Alan
				 mit-eddie!nessus
				 Nessus@MIT-MC

				"What does 'I' mean"?

 

brownell@harvard.ARPA (Dave Brownell) (06/23/84)

To barmar@mit-eddie:

    Yes, I know about the OS running on the Symbolics LISP Machine.
    I admit it is one of the most advanced pieces of software of
    its class.  I would be overjoyed to have one on my desk.

    But ... I asked for an OS written in LISP or some object oriented
    language that supported ONE HUNDRED users ... unless there's been
    some amazing advance that I hadn't heard of, a lisp machine is
    basically single-user.


Dave Brownell
{allegra,floyd,ihnp4,seismo}!harvard!brownell

rcd@opus.UUCP (Dick Dunn) (06/26/84)

>>	From: brownell@harvard.ARPA (Dave Brownell)
>
>>	But ... I asked for an OS written in LISP or some object
>>	oriented language that supported ONE HUNDRED users ...
>
>Take a hundred Lisp Machines.  Connect then together with a network.
>Put on some file servers, print servers, etc.  Voila, you have a
>computer system that supports ONE HUNDRED users...

Sure.  And, to borrow the tired old analogy, if I ask to have a child
born in one month, you'll just find nine women for the project!

The argument that <n single-user machines> = <one n-user machine> doesn't
hold, even with a network to connect the single-user machines.  If you try
to get the sort of interaction possible on the large machine, you end up
with n processors doing nothing but I/O.  Moreover (but a slight side
issue) the single large machine can focus resources briefly on a large
problem that will hopelessly overwhelm the small processors.  I'm not
saying that the large machine is superior; it's just different and not
reasonably comparable to a collection of small machines.

(BTW, what's the cost of those hundred LISP machines?)
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
	...Relax...don't worry...have a homebrew.

nessus@mit-eddie.UUCP (Doug Alan) (06/30/84)

>	From: brownell@harvard.ARPA (Dave Brownell)

>	But ... I asked for an OS written in LISP or some object
>	oriented language that supported ONE HUNDRED users ... unless
>	there's been some amazing advance that I hadn't heard of, a lisp
>	machine is basically single-user.

Take a hundred Lisp Machines.  Connect then together with a network.
Put on some file servers, print servers, etc.  Voila, you have a
computer system that supports ONE HUNDRED users, and the OS is written
in Lisp.  And it's been done.
-- 
				-Doug Alan
				 mit-eddie!nessus
				 Nessus@MIT-MC

				"What does 'I' mean"?