3 ms·
If you had a 1,000 line BASIC program and a syntax error on line 793, you often wouldn’t find out unless that line executed. BBC Basic would check each line fo
by codeulike 5y ago
If you had a 1,000 line BASIC program and a syntax error on line 793, you often wouldn’t find out unless that line executed.
BBC Basic would check each line for syntax errors as you typed it in, so you didn't need to wait for that line to execute in the program. But ... all it would tell you if it found a syntax error was: "Syntax Error"
edit: And why didn't it give a more helpful message? Because the BBC Basic interpreter was squeezed into a 16kb ROM and so everything was pared down. It was written by Sophie Wilson, who a bit later co-designed the first ARM chip.
edit: Sometimes if it could make no sense of the line at all, it would also just say "Mistake at line 40" and looking back at that now, thats quite bold and to the point. Todays computers rarely tell their users that they have made a mistake in such a blunt way.
- teh_klev 5y ago> BBC Basic would check each line for syntax errors as you typed it in From memory, I think that's because BBC basic tokenised each line as they were entered. This also made it deceptively efficient with memory. BBC Basic was really quite a neat thing back then (especially the built-in 6502 assembler).
- Someone 5y agoIt would surprise me if any interpreted basic would store keywords as strings in memory. Replacing them by single bytes is more efficient on memory and makes interpreting the program simpler and faster (if you see a P, you won’t know yet whether that’s part of PRINT, PEEK, POKE, or of an assignment to P or P$). Memory and cycles where so expensive that you couldn’t afford not to make such optimizations. The Commodore Basics certainly replaced keywords by tokens (https://www.masswerk.at/nowgobang/2020/commodore-basic-renumber https://www.masswerk.at/nowgobang/2020/commodore-basic-renum...)
- dhosek 5y agoI think this was a feature common to all the Microsoft BASICs of the era. I don't remember if the TRS-80 BASIC did it or not since most of the screen time I got on one of those was standing up at the display computer at the Radio Shack about a mile from my house, while I had a lot of time with Apple Computers. Apple's original Integer BASIC (written by Woz, natch) did not tokenize its input. I don't recall if it did any syntax checking at input because it was hard to get a hold of in the post AppleSoft BASIC era (I did eventually get a hold of a pirated copy on floppy disk that could be loaded into the himem region on a 64K Apple ][+ or //e but that was useful mainly for Woz's MiniASM that was in the part of ROM that was left over when he had Integer BASIC loaded).
- oofoe 5y agoSinclair ZX BASIC actually checked for syntax errors as you typed. Because they abused the character table to "pre-tokenize" all the BASIC statements, you couldn't actually misspell anything either. (ZX80 and ZX81 at least.)