News for hackers. Stuff that matters.
Re:Building a BASIC Interpreter, '80s style by rbanffy on Saturday July 04, 2020 @06:58AM (#23731482)
In most 8-bit BASIC interpreters, the LIST command is, actually, a pretty printer: it reads and parses the tokenized source from memory and outputs it to the "terminal". On the Apple II, for instance, we see upper-case versions with added spaces for clarity (and some annoyance for editing the on-screen code on very long lines).

It just occurred to me we missed an opportunity there, with computers that could display some form of screen attributes (Atari, VIC-20, C-64 and countless text terminals), to make use of color and typography to enhance screen presentation with a negligible cost in ROM.

It'd have been really cool to have color syntax highlighting on 8-bit computers in the late 70's...

Re:Building a BASIC Interpreter, '80s style by photokandy on Saturday July 04, 2020 @12:23PM (#23733277)
OMG--that would have been SO nice to have. I don't think I got my first taste of syntax highlighting until I got access to Turbo Pascal.

Adding it to Retroputer BASIC should be trivial. I think I'll have a go at it tonight, since it has support to use control codes to change the text color.

Re:Building a BASIC Interpreter, '80s style by pmiller2 on Saturday July 04, 2020 @02:34PM (#23734051)
That's true, but it's typically not a very nice pretty printer. For example, I don't know of any old school version of BASIC where the LIST command shows any sort of indentation.
Re:Building a BASIC Interpreter, '80s style by photokandy on Saturday July 04, 2020 @02:59PM (#23734189)
A quick search indicates that BBC Basic had a LISTO command that could add indents. I should see if I can add something similar.