From: jeff@aiai.ed.ac.uk (Jeff Dalton)
Newsgroups: comp.lang.scheme
Subject: Re: New York Times article
Date: 15 Apr 92 19:03:35 GMT
Organization: AIAI, University of Edinburgh, Scotland

In article <sc6eiINN3nb@agate.berkeley.edu> bh@anarres.CS.Berkeley.EDU (Brian Harvey) writes:
>I guess what I'm trying to say is this:  It's misleading to say, "instead
>of arguing about programming languages let's settle the important content
>we want to teach and then do that in whatever language is at hand."
>It's misleading because the language argument *is* the argument about
>important content, only slightly disguised.

I think there's a lot to be said for that.  It's an important
point.

Indeed, let's apply it to Basic.

There's certainly evidence that the language embodies decisions about 
content.  For instance, Dartmouth Basic has "mat" statements for doing
matrix operations.  They're there in part because Kemeny wanted to
do things with Markov chains (such as the "weather in Oz" problem).

An important idea in the design philosophy behind Basic is that
it should be easy to do simple things.  That's why you aren't
required to declare the dimensions of matrices and why there's
a simple "print" statement for output.  "print" is a big improvement
over "format" in Fortran which, at the time, was the point.  However,
it really is easy to do the kinds of output envisioned as typical
for Basic programs.  You want columns, use comma.  Eg "print x, f(x)".
To print one thing right after another, use ";".  Eg

   print "The answer is "; x

Basic tries to have a simple syntax (eg, you don't have to worry
about whether ";" is a separator or terminator, and you can say "for
i = 1 to 10" instead of something more cryptic).

In short, Basic is trying to get away from the excessive syntax
of the Algol-like languages and the extremely weird conventions 
of, say, Fortran.  It isn't trying to emphasise strong typing and
Pascalish thinking.  Nor is it aimed at "data structures".  If
you want to count the leaves in a binary tree, Basic isn't the
best language to use.  But if you want to use numebrs, matrices,
and strings it's not so bad.

Anyway, in my opinion, Basic would have been better if it had
embodied some of the ideas behind Lisp.  In particular:

  * Functions as objects

Basic (and by "Basic" I mean the better varieties of it) already
allows function names as parameters.  But it would be better if
it had a notation for anonymous functions (eg, "fun x => x+1"
as in ML) and allowed functions to be returned as results.

  * Typed objects instead of typed variables.

For one thing, it's silly to have to invent a new magic char
(as in a$, a%, etc) whenever you come up with a new type.
Basic could have dropped declarations completely if the designers
hadn't thought of types as something to be known at compile time
and attached to variables.

Moreover, Lisp-like thinking would have made for better arrays.
Basic let's you redimension arrays but doesn't let you allocate
them.  The designers of Basic were in the grip of the idea that
arrays were something whose size (well, max size) could be determied
at compile time.  They did a much better job of strings.
(I think Basic is better than Scheme for string processing and 
for much of I/O.)

-- jd