Chromatix wrote:
The key problem that is solved by line numbers is instructing the interpreter where in the program to insert (or replace) the code line. Screen-based editors were not common in the 1970s, and wouldn't be compatible with a simple "glass TTY" anyway. I believe the code associated with this will be both simple and compact, whereas a screen editor would be a project unto itself and rather more hardware specific.
Incidentally, "replace line" would be implemented as "delete line" immediately followed by "insert line". Simplicity over speed.
This.
Note that Comal uses line numbers but only for program entry/editing (As does my Apricot system) - there is no GOTO a line number as such - which then presents an issue - BASIC traditionally has a GOTO (and GOSUB) and very few old-time BASICs had the relevant structured programming styles to do without it. Worse (or as a necessity), there are various computed GOTO systems including GOTO/GOSUB a variable - as demonstrated in the above Mandelbrot program...
There were many text editors in the day (and today) that didn't use line numbers though -
TECO in the early 60s,
ECCE (Edinburgh Compatible Context Editor, also written in the 1960s) and sometime later in about 1973 the
ed text editor appeared in Unix. Over the years I've used many text editors including
YALOE (Yet Another Line Oriented Editor),
em (Editor for Mortals, Unix) another horrible
ed on Primos and, some odd one under Northstar DOS, and a good few others, but the issue here would be writing the editor and a sub-system to support it...
TinyBasic started with tapes - paper tapes being punched on a TTY33 ... So you don't even need save and load commands, so "bare metal" operation is much simpler.
So I think sticking with line numbers is relatively easy.
But implementing a renumber command when you have computed GOTO/GOSUBs is nigh on impossible...
When I wrote my own BASIC interpreter (It's in C and will never run on an 8-bit micro) it used traditional line numbers but could also work without line numbers if you used an external editor - but pressure from some users resulted in a built-in screen editor - adding another 1500 lines of code to the project, so sometimes you just need to stop...
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/