Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!cs.utexas.edu!uunet!sytex!smcl
From: smcl@sytex.com (Scott McLoughlin)
Subject: C and Lisp, etc.
Message-ID: <mLo5sc2w165w@sytex.com>
Sender: bbs@sytex.com
Organization: Sytex Access Ltd.
Date: Fri, 23 Sep 1994 23:04:09 GMT
Lines: 55

>> hutch@RedRock.com (Bob Hutchison) writes
Use of a hardware model to aid in learning a programming language
would apply to most languages.  I don't doubt that there is a suitable
hardware model to explain lisp, but I don't think it is the same one.
Unfortunatly the one availble to a C programmer is the one taught,
at least where I went to school.

The other difficulty with languages like the lisps and other high level
languages, is that they provide a fair bit of support for the
development of 'software'.  I wonder what a hardware model of
a continuation in scheme or ml would look like, or a non-deterministic
program written using them?  What is the hardware model for an
abstract data type for that matter?  What is the hardware model
for a CL macro?  (this macro idea is one that seems to be somethin
that a C programmer has an awful time comprehending, possibly
it is just an 'I don't believe you' problem rather than a 'what would
I do with it?' problem) 
>>------<<

Howdy,
        Nice, thoughtful post.  I got into Lisp a few years ago 
working through Kamin's "Programming Languages: An Interpreter
Based Approach". In addition to providing many interpreters, he
discusses compilation of Lisp/Scheme at the end of the book. Until
now, I've never fully appreciated the mileage I've gotten out
of the simple picture of compiled Lisp he provides.
        But you are right regarding the "CPU model" deficiency and
Lisp.  This is too bad, given that compilation of Lisp for stock
hardware is common practice these days.  SICP provides an abstract
Scheme CPU and a compiler for it, but SICP is rough going even for
smart folks.
        Anyway, I've been banging on a Windows .DLL implementation
of a bytecode compiled Common Lisp subset. While this is currently
consuming all of my time, I've been toying with the idea of a 
Lisp compiler that would generate 80386 asm output. I've been
researching object layouts, primitives, register usage, etc. The
idea is shaping up as a learning tool (for me too!) -- skip whiz
bang compiler features so that the implementation could be _read_
by a non-rocket scientist. Of course, the compiler would be
written in Lisp and would "meta-compile" except for a minimal
asm kernel (I think PSL had a similar structure).
        Maybe such a project could be used to provide a simple
"machine model" for Lisp.  The vast majority of Common Lisp 
translates, I think, to a straightforward stock CPU implementation.
Of course, one gets into a bit of rocket science to do it 
exceptionally _well_.  Given that all macros are expanded at
_compile_ time, I don't think macro's provide much of a
challenge.  The one thing I find weird is macrolet/symbol-macrolet.
These would best be explained using a simple comiler model.
        Anyway, anyone out there want to fund a book project?

=============================================
Scott McLoughlin
Conscious Computing
=============================================
