[I know this thread has the potential to cause a massive flamewar and/or a few hundred GD threads. Remember that this is IMHO, and that certain comments should be placed in the appropriate spot.]
So I ask the Dopers, what great idea will probably never come to pass? What idea sitting on your head will never come to pass, due to the general ignorance of The Powers What Are?
My idea is to have calculators work in true programming languages, as oppsed to clones of the execrable BASIC. For this task, not all languages are suitable. Ideally, programs should be writable in the same language one operates the calculator. This means the language is interpreted on-the-fly, as opposed to being compiled to machine language (as in C and most other languages) or bytecode (as in Perl and Java). This gives a few advantages:
[ul]
[li]Low overhead for the calculator developers: They can write one interpreter in ROM and have it function both as an interactive shell and a program interpreter.[/li][li]Ease of learning the programming language: Users who know how to operate the calculator have the first steps to knowing how to program it if they can program it in the command language they’re using anyway. This advantage ties in with the first.[/li][li]Software development in the calculator itself: This makes the calculator infinitely more useful, as a good user can write what he needs without having to switch environments. It also avoids the hassle of getting data to and from the calculator.[/li][/ul]
Few languages are interpreted in this fashion. Of those that are, many are too complex to be easily stored in the limited environment of a calculator’s ROM. Python and Ruby, while great languages in many respects, fail on this count. Of the languages that are interpreted on-the-fly and are simple enough to be held in ROM, two are, in my opinion, good for use in a calculator:
[ul]
[li]FORTH: The programmer choice, FORTH is a minimalist language completely given over to the idea of stack manipulation. It is completely in RPN, meaning operands precede operators (e.g., 3 5 + yields 8, and 2 4 * 2 + yields 10). This has the advantage of rendering rules of precedence meaningless: Order of operations is explicit in how the equation is written. FORTH certainly fits the minimal criterion, as it is one of the langauges commonly used to program embedded systems that comprise a few Kbytes of RAM and a slow CPU. It is also a very extensible language: Programming consists of defining new ‘words,’ which then are usable commands in the language itself. The modularization of code this teaches is alone enough to set it above BASIC.[/li][li]APL: The math geek choice, APL is a language where commands are frequently single symbols in a huge character set and programs tend to look like algebraic equations. An algorithm to find primes is less than twenty characters, something that redefines ‘concision’. APL just exudes concision, which means programs won’t take up much space. Having APL as an interactive shell’s language would take the calculator to new levels, but would probably require either a true space cadet keyboard or extensive use of shifting and menus. It would be worth it, however, to be able to have all of that sheer mathematical force at your fingertips.[/li][/ul]
My final analysis? My decision, FORTH or APL? I don’t have one. FORTH would be easier to implement and would be easier to design command entry around, but APL is tailor-made for this application. APL would require a breathtaking amount of ROM just to contain all of the symbols and their meanings, which would probably slow down the system, whereas FORTH would give F-16-like responsiveness. However, APL would require very few exensions to give it desireable capabilities (producing a list of numbers from zero to n is a language primitive in APL, for example). Suffice to say, I would eagerly buy a calculator based around either APL or FORTH.
I understand Hewlett-Packard made (makes?) RPN calculators that can be programmed in their own RPN-based language. How does the HP RPN language compare to FORTH?