3.1243 programming languages, cont. (297)

Willard McCarty (MCCARTY@vm.epas.utoronto.ca)
Fri, 30 Mar 90 23:27:48 EST

Humanist Discussion Group, Vol. 3, No. 1243. Friday, 30 Mar 1990.

(1) Date: Fri, 30 Mar 90 02:01:38 CST (186 lines)
From: Richard Goerwitz <goer@sophist.uchicago.edu>
Subject: more opionionated comments re programming lang's

(2) Date: Fri, 30 Mar 90 04:14:20 EST (47 lines)
From: David.A.Bantz@mac.dartmouth.edu
Subject: Re: 3.1233 programming languages

(3) Date: Friday, 30 March 1990 1009-EST (39 lines)
From: HUMM@PENNDRLS (Alan Humm Religious Studies U. of Penn)
Subject: yet more on programming

(1) --------------------------------------------------------------------
Date: Fri, 30 Mar 90 02:01:38 CST
From: Richard Goerwitz <goer@sophist.uchicago.edu>
Subject: more opionionated comments re programming lang's

Since we Humanists are the beginning of what is becoming a better-
defined subset of the computer-using population, these "language
wars" aren't trivial. It is good for us to hash it all out now in
an open forum - one where others with similar needs can "meet" and
discuss problems.

(Having made my excuse, let me indulge myself once more, and enter
the fray.)

Many thanks for the note, forwarded by our now lame-duck moderator :-),
written originally by KANSKI@CWRU. It read:

>Tell them SCHEME is the only way to go. The language you use (including
>English) structures the way you think about and deal with concepts. Some
>languages are better for some concepts (hence lambda calculus in math).
>Scheme (and the Red MIT book) are (teach) a better way of thinking about
>problems. Once you've thought about things in a scheme manner, you'll be
>changed (for the better) for life.

Scheme is what they start many beginning programmers with here at the
University of Chicago. I've only had experience with it indirectly
via a wonderful book called the Little Lisper. I've used Common Lisp
some, and never got used to the look of it. Probably Scheme should
be next on my list. Do any other Humanists out there have experience
with Scheme? How good is it for information manipulation, storage,
etc.? Parsing? Pattern matching?

Jane questions my description of Pascal string-handling facilities
as nonportable. She says -

>I was puzzled by two aspects of Richard Goerwitz' posting concerning
>PASCAL's string-handling facilities: (1) that PASCAL presumably lacks
>extensive string handling facilities EXCEPT when (2) they are added
>locally in which case they are non-portable...
>I was very favorably impressed by Turbo Pascal's string handling
>capabilities, which certainly seem extensive enough, and Turbo Pascal is
>certainly very portable. I must assume that Richard was thinking of a
>different or less portable version of Pascal that Turbo Pascal.

I don't believe I explained myself very well. The very fact that a
string-handling function is specific to Turbo Pascal means that one
should avoid it when writing portable programs. By "portable" I
mean that the programs can be ported very easily to another compiler
or another operating system. As software evolves, emphasis (some-
what ironically) is being placed on stability and portability. Most
manuals for mid-size computers have sections entirely devoted to
writing portable code. Books are written on the subject. To get
socked into the architecture of a specific machine, or worse yet
a specific operating system, or worse yet a specific vendor's
compiler on a specific machine running a specific OS, may make for
real difficulties a few years down the line.

My personal opinion is that, if someone in the Humanities is trying to learn
about computers, he or she should minimize the amount of relearning
necessary. Start with a language with a fairly uniform definition,
and which offers a full set of facilities for the sorts of information
storage, searching, and retrieval a Humanist is likely to require. IF
possible, make sure the language also has a uniform, non vendor-specific
definition, and is reliably implemented on a number of platforms. These
conditions, if taken seriously, exclude most of the programming languages
discussed so far.

C is too low-level. Pascal doesn't have standard, portable string or
symbol-handling facilities. Snobol is not a modern, procedurally ori-
ented language. Basic - ditto (without even the nice string-handling
facilities). Fortran - ditto (I guess I should be using caps, as in
BASIC and FORTRAN). Lisp is nice, and more widely implemented, but it
is being supplanted (was never used?) in Japan and Europe by Prolog.
There are also a jillion dialects, Franz Lisp, Common Lisp, Scheme,
etc. Maybe we'll have something here when the dust settles. As noted
above, I'd like to hear more about Scheme from a Humanist's perspective.

I keep harping on this, but Icon is cheap, it offers nice string and symbol-
handling facilities. It has a clean, modern, modular design, and is
very, very portable. Implementations are available for it on many,
many small and mid-size computers, and these implementations are all
pretty much sound. It offers most things we need, with perhaps one problem
(see below on object-oriented languages).

John Baima stated in a recent posting:

>My two language choices for an introductory class in
>programming for HUMANISTS would be Pascal or Smalltalk.
>Pascal was designed as a teaching tool and I do not think it
>has been surpassed as a tool for teaching traditional
>procedural languages. It is clear and simple yet has
>important features that are not in languages such as BASIC or
>C (e.g., enumerated ordinal types). C would be about my last
>choice for learning programming. The very attributes of C
>that make it a favorite of professional systems programmers
>are the very things that condemn it as an introductory
>course, in my opinion.

I respect JB's views, and agree with what he says about BASIC
and C. However, I have to wonder about Pascal (I don't know
any Smalltalk), though, for the reasons outlined above (not
best suited to Humanists' needs, string stuff not portable, etc.).
Since I'm not an instructor, and speak merely from my own experi-
ence, I wouldn't want to put up too much of a fuss, though. It
just seems to me that the standard way of starting comp sci
students (Pascal), might not be best for those interested in non-
numeric computing. It certainly wouldn't have been for me.

>While ICON has many powerful commands, and one of my
>colleagues here likes it a lot, I think that it is very
>unsuitable for *learning* how to program. ICON does not have
>operator overloading for even simple operators like "+" which
>means that every combination of every data type needs a
>different operator to add two things together. The last time
>I looked, Icon had almost 30 assignment operators. What a
>mess for the beginner!

Icon is neat in that a beginner can get away with a very, very
small subset of the available facilities. I can attest, from per-
sonal experience, to the fact that it is fine even for someone
who has no instructor (i.e. for self-teaching).

Let me also add that, while JB is right that you need to use
a different operator to "add" every data type, I found this
quite natural myself. I really don't see a problem. Adding inte-
gers is quite different than adding strings, (character) sets,
hash tables, lists, etc. Each one reflects an underlyingly dif-
ferent operation. Multiple ops is infinitely preferable, in my view,
to a situation at the other end of the pole, where the language
will let you, say, add two pointers, or subtract two sets. (What
am I saying? Most languages don't even *have* sets!) Worse yet
are solutions which have, say, "+" mean different things for dif-
ferent data types, or which permit the user to redefine infix or
other operators as desired. C'mon! I've got to be able to rely
on some consistency in the language. If I can't even count on what
"+" means, what's the sense in living any more?

Probably the *main* criticism that might be levelled against Icon
is that it is not object-oriented. Object-oriented extensions are
available, but this just isn't the same thing as full integration.

Life isn't perfect. Maybe Smalltalk after all? Maybe some comments
on this language - from a Humanist's perspective, of course - would
be nice.

One more point about Icon: Learning Icon is not as trivial as JB
makes it out to be. As I said above, it does permit the user to
treat it as a honed-down Pascal-like language with nice string-
handling facilites, but this isn't all it can do.

If, of course, you've written programs using suspend, data back-
tracking, control backtracking, coexpressions, coroutines, or cus-
tom-made matching procedures, and have found all of these features
trivial to grasp, that you are just a helluva lot smarter than I
am :-).

A final (general) word: One person said in a posting (I forget where, but
I have the quote lying around): "[N]early all CS students learn
Pascal and C. These are both excellent languages, though I find
Pascal more user-friendly." It's hard to disagree with this. It
was the conclusion that I found illogical: "Learn Pascal." All
the main textbooks in C and Pascal are filled to the brink with
programs geared for the cs student. Very little is really avail-
able for Humanists in the way of introductory materials. What
little there is seems to come indirectly, via the AI people, and
others interested in nonnumeric computing. Whether we learn Pas-
cal, C, Icon, Smalltalk, Scheme, BASIC, or anything else, the whole
process could be make much easier if there were more Susan Hockeys
and Alan Corres out there writing books for us. Given the sparsity
of appropriate introductory materials, I'd vote that we at least
select languages that, from the ground up, are designed for the
sort of thing a Humanist is likely to do. I vote Icon. However,
from this discussion I've learned that Scheme or Smalltalk might
also do. Pascal, C, BASIC, etc. are (in my opinion) less well
suited to the task. Snobol is nice, but it is subject to the cri-
ticism now being laid at the feet of non-++'ed C and Pascal dialects,
namely that they are just not in step with the times.

Even though for some it might seem we've gone on a bit, I've enjoyed
this discussion, and hope to see more on it. I'd especially like
to know more about whether I should learn Scheme or Smalltalk. (So
much for reducing the volume of Humanist mail!)

-Richard L. Goerwitz goer%sophist@uchicago.bitnet
goer@sophist.uchicago.edu rutgers!oddjob!gide!sophist!goer

(2) --------------------------------------------------------------58----
Date: Fri, 30 Mar 90 04:14:20 EST
From: David.A.Bantz@mac.dartmouth.edu
Subject: Re: 3.1233 programming languages

Dartmouth courses in mathematics and sciences often use Basic; students are
required to write simple Basic programs to solve problems in math, data
analysis, graphing, etc. Most instructors would claim *not* to be teaching
programming or computing per se. Computer science, in contrast, does *not*
use Basic for introductory or any other courses. Introductory courses use
Pascal (Think Pascal for the Macintosh); many later courses use C in various

The "Red MIT book" referred to in another posting is _Structure and
Interpretation of Computer Programs_ by Harold Abelson and Gerald Jay
Sussman, with Julie Sussman. I think it's fair to say that it is a very
advanced introduction which aims to provide very sound foundations for
computer science, introducing levels of abstraction, recursion, and
challenging puzzles within the first few pages.

Is a good programming language for introducing the concepts and techniques of
computer science (Scheme- a dialect of Lisp, or the older Pascal) a good
language for humanists to start with? Perhaps it is if they want to explore
parsing, natural language understanding, or become a developer in a wide area
of applications. Perhaps not if the goals are to develop a facility for a
more defined range of tasks. Basic works very well for the resticted needs of
introductory math courses becuase it is a straightforward procedural language,
has (in the implementation used here) excellent high level support for such
things as matrix manipulation and simple graphing; its failure to enforce or
encourage structured programming or efficient code is less important for these
courses than its ease of use which allows the instructors to maintain the
focus on math rather than programming. Is there an analogous case to made
for Icon or another language for some humanist purposes?

--- Stephen Clausing <SCLAUS@YALEVM> wrote:
I doubt that there is a single
CS dept. in the country that teaches Basic to its students (Ok, maybe
Dartmouth does, but that's special).
--- end of quoted material ---

--- "cjs" <KANSKI@CWRU> wrote:
... SCHEME is the only way to go. The language you use (including
English) structures the way you think about and deal with concepts. Some
languages are better for some concepts (hence lambda calculus in math).
Scheme (and the Red MIT book) are (teach) a better way of thinking about
problems. Once you've thought about things in a scheme manner, you'll be
changed (for the better) for life.
--- end of quoted material ---
(3) --------------------------------------------------------------44----
Date: Friday, 30 March 1990 1009-EST
From: HUMM@PENNDRLS (Alan Humm Religious Studies U. of Penn)
Subject: yet more on programming

In a recent posting Jane Edwards suggests that Turbo Pascal's
string handling is both "extensive enough" and portable. In response
to the first suggestion, "extensive enough" really depends on what
you want to do. You CAN do most anything that can be done with
strings in any of the languages that we have discussed recently.
The issue is how easily, and how much will be supported by the
compiler's library of machine-language functions (= speed) and how
much you will have to write yourself, or obtain from someone's
collection of functions/procedures. Pascal is not at the bottom
of the list here, and Turbo Pascal is certainly more powerful
than standard Pascal. But there are other languages that have
slicker and easier ways of doing these sorts of things. I am
not familiar with either SNOBOL or ICON, but I glean from the
discussion that these are better with strings. I know from
experience that Ibyx and Smalltalk have strong string handling
capabilities. But Pascal is certainly better than 'C' (in general -
there are important exceptions).
Turbo Pascal is not even portable to all other implemantations of
Turbo Pascal. Try moving your PC-Turbo code to Mac Turbo. Worse,
try going the other direction. Standard Pascal (I do not know about
ANSI) does not even have a "string" type, and this is what you will
have on your mainframe, or your VAXen. Of course you CAN write
portable code in Turbo, but then you loose most of your powerful
string handling capabilities.
OAKMAN_D1@PLU, in an apology for BASIC asks "who cares if it is
'spagetti code'". The answer is "If you are the only one using it,
and if never expect to need to change it, noone cares." We should
keep in mind that what we were discussing here is not what we use,
but what we teach. Bob Kraft, who as I recall initiated the discussion
by advocating Pascal (or C) against BASIC, does not, to my knowledge
program in any language but Ibex. He did not however suggest that
we shold be teaching introductory programming in that language.

Alan Humm (Humm@PENNdrls)
University of Pennsylvania