Whitespace as syntax (was Re: Python Rocks!)

Gareth McCaughan Gareth.McCaughan at pobox.com
Thu Feb 10 16:44:59 EST 2000


Paul Prescod wrote:

> You are right that Lisp-ers (and Smalltalkers) have gone to great
> lengths to promote their languages. My hypothesis is that they have not
> gone to great lengths to *adapt* their languages for popularity. This
> leaves the vast majority of programmers in C++ hell -- sometimes by
> choice and sometimes through environment.

I think it's possible that some of the changes that would be
necessary to "adapt their languages for popularity" would also
damage the things that make those languages better than "C++
hell" in the first place.

For instance, lots of people are afraid of Lisp because the
syntax looks funny -- eeurgh, all those parentheses. But
that funny syntax is a crucial part of Lisp's strength,
because it's what enables the powerful macro system that's
such a vital part of Lisp.

(Smalltalk syntax looks funny, too, but it isn't so fundamental
to the language. Perhaps a more approachable version of Smalltalk
might be possible.)

But the main reason -- so far as my limited observation shows --
why so many people think that Lisp and Smalltalk are no use is
something that the Lisp and Smalltalk communities really can't
do all that much about. Namely, there are a bunch of myths about
both languages, very widely purveyed, and entirely false.
"Lisp programs are really slow". "You can't do low-level stuff
in Lisp". "Lisp systems have to be really big and bloated".
"Smalltalk is a toy language". "Garbage collection means that
your program will stop working for several seconds at random
times". "Lisp is only for AI programs".

These legends were mostly true once upon a time. They're utterly
false now. But they scare people away. Perhaps they could be
banished by a sufficiently vigorous marketing campaign by the
Lisp and Smalltalk communities, or by the vendors of Lisp and
Smalltalk systems, but they really don't have the resources
for that.

>> Er, it's not obvious to me where 'programming language' ends and
>> 'development environment' begins. A programming language is an
>> interface between the programmer and the computer, and so is the
>> IDE. The line between the two is necessarily somewhat artificial.
> 
> No, there is a very clear line. A language is a set (usually infinite)
> of strings. A programming language is a mapping from each of the strings
> to a program (let's say a Turing machine). 

Let's *not* say a Turing machine. Real programs run on machines
that are connected to the outside world, and their behaviour
can involve things like graphics, user interaction, and network
communication. And it's exactly the presence of these things
that makes the division between language and environment sometimes
misleading.

Suppose a language is specified as including a TRACE statement,
defined in some such terms as "After `TRACE foo' is executed,
and until a corresponding `UNTRACE foo', every invocation
of the procedure `foo' will result in the output of a diagnostic
message with such-and-such a format. The message is sent to
the USER-INTERACTION stream." Is that part of the language or
part of the environment? What if there's also a BREAK statement
that establishes a breakpoint? Is that language or environment?

What if other objects in the environment are explicitly defined
by the language specification to be manipulable by the program?
Suppose your language's library (and the library *is* part of
the language, right?) includes a function defined to pop up a
browser window in which the user can inspect the current state
of the program and select one of the program's variables, whose
binding will then be returned as the result of the function call?
Language or environment?

(These examples aren't taken directly from real languages,
nor should I be assumed to think they're good things to have.)

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
sig under construction



More information about the Python-list mailing list