Post Reply 
HP-71 BASIC funny quirks
01-28-2023, 04:03 AM
Post: #8
RE: HP-71 BASIC funny quirks
Either shunting yard or operator precedence parsing of expressions is fine, or even recursive descent, but it's far from the whole story. Even ignoring overall statement syntax, dealing with variable names, which have to be looked up, is slower than dealing with variable addresses assigned at statement entry time (even if a hash table is used at runtime), and dealing with numeric values that weren't parsed at statement entry is also very time consuming. And even though the rest of the parsing is fairly efficient, it's still usually a win to do it at entry time rather than every time the statement is executed.

Many years ago I had empirical data on 8-bit machines (6502 and Z80) that even just crude keyword tokenization like Microsoft BASIC interpreters used significantly sped up BASIC interpreters. I don't hink I have any of my old notes on that.

What HP-71B BASIC does, and Apple II Integer BASIC (by Woz, not by Microsoft) does, goes far beyond the simple string tokenization of Microsoft BASIC, and yields an even bigger execution speedup, because the symbol table is constructed, no variables have to be searched for at runtime, and numeric constants are already in native binary form. This is a huge win over the Microsoft style keyword tokenization, not just "over engineered".

It's not just the little microprocessors that benefit from this, either. These techniques were developed for speeding up interpreters on mainframes in the 1960s and minicomputers in the 1970s. HP 2000 Timeshared BASIC, implemented on HP's 2116, 2100, and 21MX 16-bit minicomputers. used similar techniques, though not quite as advanced as the HP-71B or Apple Integer BASIC, and it was an enormous win.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-71 BASIC funny quirks - J-F Garnier - 01-27-2023, 08:55 AM
RE: HP-71 BASIC funny quirks - Albert Chan - 01-27-2023, 02:56 PM
RE: HP-71 BASIC funny quirks - J-F Garnier - 01-27-2023, 04:21 PM
RE: HP-71 BASIC funny quirks - robve - 01-27-2023, 10:35 PM
RE: HP-71 BASIC funny quirks - robve - 01-28-2023, 02:55 AM
RE: HP-71 BASIC funny quirks - Albert Chan - 01-28-2023, 12:39 PM
RE: HP-71 BASIC funny quirks - J-F Garnier - 01-28-2023, 05:03 PM
RE: HP-71 BASIC funny quirks - brouhaha - 01-28-2023 04:03 AM
RE: HP-71 BASIC funny quirks - robve - 01-28-2023, 02:51 PM



User(s) browsing this thread: 4 Guest(s)