Hacker News new | ask | show | jobs
by LeoPanthera 890 days ago
BBC BASIC is surprisingly efficient for an interpreted language. It kind of had to be, running on processors that slow.
2 comments

all the basics i used on processors that slow were surprisingly inefficient, even for an interpreted languages

i thought they had to be, running on processors with that little memory. though later on i learned about forth, which is surprisingly efficient for an interpreted language

a more likely explanation is that sophie wilson was just a better hacker than bill gates and paul allen

Yeah, BBC BASIC is really good. Both the language design and the implementation.

I loved it at the time, and the more I think back on it the more impressed I am. Like it had a very decent suite of floating-point routines, which if I remember right were very performant. In a 32KB ROM!

Some of the improvement in BBC BASIC over Microsoft's BASIC is attributable to the larger ROM(the first Altair BASIC was just 4k), but it's also that the BBC Micro's 6502 and DRAM was clocked higher than contemporaries. It's just a faster, more refined 8-bit machine all around.
Basic was actually a 16KB ROM. MOS occupied another 16KB ROM.
Dang, you're right, I was misremembering.
Some good discussion of that on The BBC BASIC wiki entry: https://en.wikipedia.org/wiki/BBC_BASIC (paragraph beginning "Due to a number of optimizations[…]".
Also you could swap out hot spots with assembly trivially as it had an inline assembler. And you had indirect pointers in it!
The OP's code has REM based assembly it in to save space
is that assembly or is that the dithering table
Yes, the REM is the lookup table used in line 70.

Because BBC Basic had a built-in assembler it was pretty uncommon for BBC programs to inline machine code as raw data (unlike some other computers from BITD).

just a table of constants.