BASIC Interactivity and Fortran labels/line numbers

Edit after Moderator Moves

If you’re finding this thread confusing, it will help to know that:

  • This head post is the fourth reply in to a discussion that started here with the comment, “[T]he key thing with BASIC was that it was designed to be interactive from day 1.This IMO is what set it apart from just about everything else at the time.”
  • The second third posts are part of that thread’s discussion of line numbers (which is not directly related to the discussion this head post), and there are additional responses to messages here in that thread.

TLDR

Interactive program development was conceived and demonstrated by LISP developers years before BASIC, and the BASIC authors got the idea directly from LISP developers. Further, BASIC, for its first two years, was less interactive than LISP, both requiring compilation and not having any facility for the program to read data from the user.

“The first interactive LISP”

I hadn’t noticed that in McCarthy’s History of Lisp he claims that Deutsch’s version was “the first interactive LISP,” which is what I guess you are referring to. But on closer examination this doesn’t seem consistent with the full paragraph:

The appendix makes it clear that this demonstration was indeed interactive use on a terminal:

(The technical description also makes it plausible that this could have been in 1960, which was pre-CTSS, since it notes an OS modification that surely would have been an integral part of CTSS.)

Deutch’s interpreter was not significantly different (except perhaps in scale, since he had to fit it on a smaller computer) from the original LISP interpreter, where one would punch a series of cards, start the interpreter, and have it read the cards. I don’t see any technical reason preventing you from punching a card, starting the interpreter, having it read the card, examining the output on the printer, and then punching your next card based on what you saw. Perhaps this was even done. But of course until time-sharing systems came along this would tie up an expensive machine that was in high demand for much longer than it would take to do the same processing as a batch.

(I’ve been unable to find a reference for when LISP was first made available on CTSS, but it certainly was made available on it at some point.)

Thus, while interactive use was perhaps not an explicit design goal of LISP in 1959 and it just happened to work out that the design supported that well, within a year or so the ability to work interactivity was noticed and seen as something useful that should be preserved.

Where the Idea Really Came From

But here the story gets even better. (And it’s also here where we can all thank you for prompting further research and a fix to the Wikipedia page.)

Thomas Kurtz, one of the developers of BASIC, had early on identified the problem of lack of immediate feedback. But as it turns out, the solution (which also prompted the development of DTSS) was given to him by John McCarthy (full quote from the preview of the book on Amazon):

Interactivity

Even here, the environment was still not quite as interactive as it might seem. First, the original BASIC was apparently not an interactive interpreter like later BASICS:

LISP, on the other hand, from almost the beginning offered both a compiler and an interpreter, directly executed its input, and even let you mix compiled and interpreted code. So there even with programs that were not “very simple” you could interactively make modifications to a small part of a program and quickly see the results.

Perhaps more of a problem as that you could not write interactive programs in the original BASIC because it had no way of reading from the terminal. It was not until the Third Edition, released in 1966, that this was possible:

LISP programs of course had to have the ability to read input from the very start, since the first LISP program was the LISP interpreter itself.

1 Like

As it turns out, JOSS appears not to have been the first; it looks to be predated by DOPE:

And the author of DOPE, John Kemény, just happens to be one of the authors of BASIC! (While DOPE was otherwise not very similar to FORTRAN or BASIC, apparently many of the lessons of DOPE were applied to BASIC; you can see the Wikipedia article and its references for more details.)

Well, you don’t really need an entirely different scheme; FORTRAN was exclusively card-based at the start and use line numbers as labels; you just didn’t need to number lines that did not need labels.

I’m not convinced that it’s “natural” to combine line numbers for editing and labels. TECO, an interactive editor first released in 1962 for the PDP-1, certainly proved that it was not necessary. (The PDP-1 had only paper tape storage at the time, so all editing would have been of “files” in a stream-of-characters format, and PDP-1 assembly language did not use line numbers.)

What I meant was that you could rearrange a FORTRAN program so that the card with label 9 actually comes before the card with label 7. So they are numbers, but not line numbers.

Some places actually numbered the cards in the columns after 72 since they had machines that could sort a deck into increasing order. Since FORTRAN simply ignored columns after 72 my university made the users put their student numbers there (the same number in every single card) to prevent cheating by borrowing cards from other students.

For places without sorting machines the most popular solution to deal with dropping the cards was to draw a diagonal line across one of their sides. As a program was edited, however, the line quickly started to look like it had been through an earthquake.

I’m not convinced that it’s “natural” to combine line numbers for editing and labels.

When I was a Freshman in college, I often saw new computer science students getting confused about editor line numbers and FORTRAN labels. i.e. setting up a GOTO pointing to an editor line number.

1 Like