Newsgroups: comp.lang.lisp
From: cyber_surfer@wildcard.demon.co.uk (Cyber Surfer)
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!yale!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gatech!howland.reston.ans.net!news.sprintlink.net!demon!wildcard.demon.co.uk!cyber_surfer
Subject: Re: Why do people like C? (Was: Comparison: Beta - Lisp)
References: <35kbl8$8ni@relay.tor.hookup.net> <CwJ88z.K2E@cogsci.ed.ac.uk> <35urdq$31p@relay.tor.hookup.net> <Cwsy26.Et2@cogsci.ed.ac.uk>
Organization: The Wildcard Killer Butterfly Breeding Ground
Reply-To: cyber_surfer@wildcard.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.27
Lines: 118
Date: Thu, 29 Sep 1994 08:28:38 +0000
Message-ID: <780827318snz@wildcard.demon.co.uk>
Sender: usenet@demon.co.uk

> But do you think LOGO is hard for old folks to learn?  (How old
> are people these days when they're learning C?)

I only learned Logo after nearly 10 years of programming, and
yet I had no trouble with it. Of course, I was familiar with
Lisp, which might have helped.

> I think it's much easier BTW to understand a Lisp interpreter
> (for a suitable simple Lisp) than a C compiler (even for a smallish
> subset of C).  So in some ways it's easier to explain how Lisp
> works.

Agreed. This is one of the stengths of Forth. A the source code
for a threaded Forth can be very easy to understand, while a
native code Forth will be much more complex, perhaps because it
won't be using interpretation so much.

What's the simplest interpreter you can write in Lisp, by the
way? What's the simplest compiler you can write in Lisp? Now
try the same things in Lisp or a thread Forth. A batch compiled
lamguage suffers from a large handicap, because the code you
write can't make use of the existing code that implements the
language itself. Some people call this "leverage".

> Well, I think an interactive Lisp is better when learning the
> language.  But the Basic model is fairly simple.  You have the
> program source, you type "run", and it runs.  C follows a more
> complex compile-and-link model.

I agree that an interactive language is better, but I only have
my own experience with an interactive Basic to judge this by.
I'd say that the batch compile approach used by C is just a more
complex way of doing the same thing as typing "run" in Basic.
It only looks different, but that's an implementation issue.

PJ Brown's book Writing Interactive Compilers and Interpreters
explains how an interactive language like Basic (or Lisp) can
also use a compiler, and make it transparent. I believe there
are Lisp and Smalltalk implementations that use such techniques,
altho I know that some Lisps require the compiler to be explicitly
invoked - a bit like a C compiler, in fact:

(edit)                             ; edit
(compile-file "foo.lsp")           ; compile
(load "foo")					   ; link
(foo)							   ; run

There's no need for it to be this explicit, and I bet that there
will be Dylan implementations that do this better. I've yet to
see a Lisp system do it as neatly as Smalltalk/V, but I've no
doubt that it can be done, and probably has been done. The typical
Smalltalk browser window is an example of how simple the editer
and compiler can be, while the transcript window makes the "run"
stage of the edit/compile/run cycle simple _and_ flexable.

I'm still waiting for an interactive incremental C++ compiler. :-)
I don't call waiting two minutes for a "compile & link" interactive
or incremental. Actor and a number Lisps can "cycle" in under two
seconds on the same machine. That's why I'm interested in Dylan,
as it seems to promise _both_ runtime speed and an interactive
incremental compiler in the one language. Unless Lisp systems can
offer me the same features, I'll probably switch to Dylan.

> I think that's a very serious problem with CL.  It's difficult
> to extract a nice subset, especially if you're new to Lisp.
> Textbooks ought to help there, but many of them cover too
> much of the language (IMHO).

I not only found a usable subset, but one that I could also
implement. It's written in about 10,000 of C and uses a subset
of about the same size as XLISP, but consisting of different
features. For example, I've yet to add arrays or structures,
but I have multiple values and full SETF semantics.

> I think it's often very hard to find things in CLtL.  Looking up
> a function name in the index and turning to the appropriate page is
> often not enough.  For instance it may talk about something that
> "satisfies the test".  That phrase is explained somewhere else
> (at the start of the chapter?).  So CLtL has some problems as
> a reference manual, and it has other problems as an introduction.

As far asI'm concern, it _is_ a reference manual. It's certainly
not a tutorial. I'm amazed that anyone could confuse it with one.
Perhaps my idea of tutorials and manuals are very different from
other peoples'?

> But 2-5 are presentation problems, not language problems.

Agreed. Just look at Dylan! Even if that's not "Lisp", it's a
good example of how to do it _right_. In my humble opinion,
of course. I'd rather use Dylan than most Lisps I've used,
despite the lack of macros. I love Lisp macros, but I'd rather
be programming, esp if there's a chance I might be paid to do
it. Right now, I'd have more chance of writing in Smalltalk
for a living, but I feel that Dylan is a more realistic language
than Smalltalk. That may be because I like the idea of sharing
code at the class level. It could certainly kill all the criticism
about footprints.
 
> Perhaps we could discuss briefly how C is taught?  I learned C
> from a book, as I did for most other languages I know, so I don't
> know how it's normally done.  (Though I've taught Lisp and Basic.)

I leared Basic on my own, at a keyboard. I only had a manual!
It took me about a day. (I'm still learning to _programme_,
which is significantly different.) I "learned" C from a book
(K&R), but it was the experience of programming im C that taught
me most of what I "know" about it. I'm still "learning"...

> I'm tempted at this point to try to write a "Lisp for C Programmers".

That would be an excellent idea! Good luck, if you do it. If you
want a co-author, I'm available. :-) If course, you might be better
of without me, as I have some odd ways of working. So my friends
tell me, anyway! (But they all use C...or Basic.)

-- 
http://cyber.sfgate.com/examiner/people/surfer.html
