Followup-To: comp.lang.lisp
Sender: psu@HUGO
Newsgroups: comp.lang.lisp,comp.lang.dylan
Subject: Re: Inner Classes in Java
References: <x5n2x4utt2.fsf@rsi.jhuapl.edu> <3278FF2A.7C6A@digitalideas.com>
	<jbrewer-0511961338320001@news.mcs.com>
	<32808216.4BB@digitalideas.com> <vrotneyE0Hr4t.LM4@netcom.com>
	<87hgn1o13r.fsf@lutefisk.jetcafe.org> <vrotneyE0wBzz.D5A@netcom.com>
From: Pete Su <psu@jprc.com>
Date: 18 Nov 1996 09:10:43 -0500
Message-ID: <usp67qysc.fsf@jprc.com>
Lines: 86
X-Newsreader: Gnus v5.3/Emacs 19.34
NNTP-Posting-Host: 207.86.147.218
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!news.duq.edu!scramble.lm.com!news.math.psu.edu!news3.cac.psu.edu!howland.erols.net!news2.digex.net!news1.digex.net!tera.jprc.com!
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:23788 comp.lang.dylan:7578

vrotney@netcom.com (William Paul Vrotney) writes:
> 
> What makes you think that a Lisp interpreter machine has to be a special
> purpose machine?  Why is an Intel 486 interpreter any more general than a
> Lisp interpreter?  

I believe that you should go back and read bits of the history of
computer architecture.  Computer Architecture is a curious mix of
design principals and a terribly Darwinian economy of ideas.  For
better or worse, there is more to building a machine that will perform
well and be useful than just putting together a nice instruction set.

Assuming that you even *could* build a piece of hardware that runs
lisp directly faster than a 486 runs it with a compiler (which I
seriously DOUBT that you can... see below) the result would be
practically useless in the marketplace.  First, you need an OS.
Second, the OS has to have applications, which would have to be
developed from scratch.  Third, the OS needs support for hardware
(device drivers) which would need to be developed from scratch.  We
are quickly approaching a time when the cost of developing these
things is much higher than the gain that you obtain by having them.
Microsoft and Apple (say) have a 15 year head start on you in this
arena, why would anyone buy such a machine?  The 486 in the PC already
has all of this infrastructure surrounding it.  It is more general
purpose not in any technical sense, but by econmic fiat.  I can do
more with a 486 PC than anyone ever could with any LISP
machine. Period, and of story.. more applications, more hardware
support, more everything... but, this is only half the story.

For better or worse, and much to the chagrin of lots of language
design types, the "von Neumann machine", as primitive as we like to
think it is, is the dominant architecture today, and has been for as
long as anyone remembers. Load/store, state based, memory hiearchy,
the whole thing.  In this environment, you don't need a compiler
because only because you can't build a high level instruction set.
With enough money, you *can* build a piece of hardware with lots of
microcode for implementing some subset of lisp, say.  The problem is,
it will run really really slowly.  Why?

The interpreter will not be able to do global code analysis to
try and figure out how to best use all the pieces of the memory
hiearchy and exectuion pipeline, this means things like register
allocation, scheduling memory read and writes to overlap with other
instructions, walking loops to best use the cache, and that sort of
nonsense. This is extremely important.  Modern processors run an order
of magnitude faster than the main memory they are hooked to... this
makes fetches and stores to main memory very expensive... which means
you never want to do that... which means you have to make sure your
code uses registers and cache well.  So, how will this magical lisp
machine achieve this?  Are you going to do this opimization by hand on
the LISP code?

No.. that's what the compiler is for.  The compiler is NOT just a box that
translates some high level code to assembly.  It translates high level
gibberish into low level gibberish in such a way as to make the low
level gibberish run faster than low level gibberish that I could have
written by hand in a comparable amount of time.  If you toss the
compiler away, you lose this factor of 2 to 4 or more in performance
gain... so would *you* buy machine without a compiler that runs at
half the speed of your current PC?  I think not.

Another point to make is that putting LISP into hardware is a very
different thing that putting FP into hardware.  FP is a compartively
small set of relatively simple primitives that are provably very
heavily used. LISP is by comparison huge.  It would violate good
design prinpals to put the whole thing into hardware... you really
only want to put the lowest level bits in, and implement the rest at a
high level so you can re-use code and hardware efficiently... but at
this point, you may as well just emulate or compile those low level
bits to a hardware, since it will be faster  for the among other
things, the reasons above... so the lisp machine dies again.

One has to realize that the current state of computer architecture is
the result of a long iterative process of gaining engineering
experience and making engineering tradeoffs.  This stuff isn't done in
a vaccum.  This stuff is done because to one extent or another, this
is the best scheme that we have worked out to date when you take all
the variables (performance, cost, OS support, inertia, compatibility,
etc) into account.

So, go back to school and study your Patterson and Hennesy.  Learn
something, then sit back and think about whether your lisp machine
will work.

Pete

