|HP-71B's BASIC boring !?|
Message #12 Posted by Valentin Albillo on 8 June 2003, 7:12 p.m.,
in response to message #9 by Vieira, Luiz C. (Brazil)
"What bothers me about the 71 is the BASIC language. I know how to program in BASIC but I think it is (sorry, BASIC lovers!) boring... and it is closer to HP85/75 BASIC (is it correct?)"
I beg to disagree. HP-71B's BASIC is anything but boring, and for its time, it was (and still is) one of the best and most comprehensive BASIC dialects in the world. By itself, it has more than 240 statements and incredibly advanced features, but when extended with the Math ROM (which was meant to have been an integral part of the machine, ROM ID 2) and the HP-IL ROM, it's simply mind-boggling. Just to name a few:
- Full set of mathematical functions and operations, defined for either scalar values (in three precisions, INTEGER, SHORT, REAL), complex values, real matrices and
- Full 12-digit, 1000-decade range, the only BASIC ever to implement IEEE management of Infinities, NANs, and denormalization. No other dialect or language does it today, AFAIK.
- Single-line and multi-line user-defined functions and subprograms, passing parameters both ways by value or reference, and allowing recursion and separate environments.
- Multi-file, multi-type RAM file system, with independent RAM possible, handles several kinds of program and data files, including language extension files and binary programs and subprograms
- Event-driven programming possible, including programmable timers, errors, I/O events, hardware and software polls, etc.
- Incredible functionality for math, including Solve and Integrate with recursion allowed, Fourier transforms, polynomial root finding, gamma, hyperbolics, random number generation, and base conversions, to name a few.
- Incredible functionality for I/O, the best HP-IL loop controller anywhere, can control up to 3 loops simultaneously, full range of both low-level and high-level I/O commands, full range of boolean operations.
- Soft and hard configuration to accept any number of external ROMs and RAM, up to 512 Kb addressing range.
and I could go on and on and on ... In short, there's nothing to even touch it, least in such a portable, small machine. I only find two flaws in its BASIC implementation: it doesn't allow two-dimensional string arrays, and it doesn't allow long names for the variables. And I guess even those could be overcome with a suitable LEX (language extension) binary file.
In real life, I've found that I can program most anything math related (incl. engineering problems, etc) in very few lines of HP-71B BASIC, and the resulting program is both easy to create and simple to understand and extend in a future date. Wish the same could be said of other languages/dialects.
As an example, I wrote a chess mate finder (which can
in principle solve any "mate in N" chess problem) in some 90 lines of BASIC code. And the program listing is anything but boring, and easily understandable. Try that with your favorite calc language ! :-)
Edited: 8 June 2003, 7:19 p.m.