HP Forums

Full Version: Why do calculator manufactures like to reinvent the wheel?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The following is not really a complaint and also not really Prime specific. I am just curious and maybe someone of HP can answer this:
Why did HP choose to invent their own programming language (again)? Why not use something more established and still comparably easy like Python, Pascal, Ruby etc?
The Prime seems to be a device which has been designed pretty much from ground up, so compatibility to older calcs can't be the reason.
I would say performance shouldn't be an issue either, at least Python is pretty fast, especially with JIT.
The learning curve is also shallow for Python or Pascal.

So no real disadvantages I'd say.
Furthermore if one uses an established language like Python one has a big standard library which could be used, in case of Python even some pretty advanced numeric and symbolic libs. Plus a lot of developers would be already familiar with the language and even more important the standard library.

And as everybody can see this is not specific to HP. TI invented their own BASIC flavour (at least NSpire eventually included Lua scripting, however its not really advertised), Casio probably too has their own BASIC flavour. So where does this drive come from? Is there a secret codex among calculator manufactures "And you shall not covet your neighbor's programming language"? :-D

I hope for some enlightening comments by Tim or anybody else being deeper involved in the innards of calculators :-)
You'll find some answers in this discussion on the old forum, starting with message #7.
I believe I've already explained this before. I'll try to make an attempt at it again. [EDIT] Thanks for linking to that! That discussion was one of the posts I was thinking about here.

First issue is memory. Without having control over the memory you get into trouble very fast. Most common languages or run times don't take that into account...

Second, we didn't invent a programming language. We made a parser to evaluate math. There is no difference internally between what you are looking at as a "program" and what you get if you evaluate the same commands in a command line.

Third, the capabilities and differences do not map to other languages cleanly. While all will have a very similar set of basics, what is offered past that quickly devolves into completely different goals and intentions.

Let's take a look at python (which is a good one since that is the first most seem to come up with). Does it have standard interfaces to do things like get keyboard input, draw to the screen, support every type of math object we support, support mapping to applications vs a global space, etc? Which libraries are you supporting? Who wrote those? Do they map to what we are trying to accomplish? Do those libraries you are talking about all even have consistency between each other in terms of numerical ranges, calculation methods, syntax, object support, etc. What about touch screen handling?

Forth, ;-) in revisiting the "different devices are different" in the last point, since there are no standard UI things that map cleanly across all devices (windows 8 anyone?) you end up wanting different UI things on different devices. While there some similarities, what happens in practice is you end up needing to write your own UI extension code and commands to provide the underlying "python" to let it interact with the system. So you end up with non-standard "python" that doesn't run directly on any other system apart from basic calculation and subroutine things.

A great example is the "Lua" that you mentioned on the Nspire. If you actually look at it, they HAD to extend it so much to give any sort of integration with the system that what you have in reality is essentially a completely different language.

You mention learning curves, yet the language on Prime is about as simple as you get. You can do something productive with it pretty much immediately. Trying to do more advanced things gets more difficult, which I think is true in basically any environment - hence being advanced-, but where things falls down is that there is not completely unified handling across all parts of the system.... which is exactly what your idea or thought to plucking a specific "common" language actually entails. You would end up with trying to merge multiple disparate systems together, have them work seamlessly, and not have any cracks showing between them. I believe that is exactly your complaining with the system right now. :-)

I've yet to see any common language or runtime that would work equally as well for a new math student, all the way through for professional use. Anyone who says "just give python or mathematica to a new student" should NEVER be allowed in a classroom.

Fifth, size. While some might say size doesn't matter, in the calculator space it traditionally has. The binary on prime is about 13 mb or so. The font takes up about 5mb there, the help content takes another very large piece. When I've looked at other run times, the only one that seems to come in at all close to the size our math libraries/parser takes is something like Lua, but that is very limited and tiny feature wise. What is the total size of a full python interpreter including libraries that will get you all the capability that is in the calculator right now? I don't think that is an easy question to answer, but I'd sure like to know. I'd highly suspect it is much larger though...
To expand on what Tim wrote:
* the Nspire's Lua is Lua at its core, but TI had to come up with a platform-specific set of APIs for event-driven programming (I'm told it maps nicely onto some existing UI frameworks), and additionally, TI butchered the standard runtime in such a way that the "io" and "os" packages are missing - IOW, among other similar arbitrary limitations, the Nspire's Lua cannot read or write files...
The Nspire's Lua has significant two-way incompatibilities with Lua for other platforms.

* a standard Python interpreter + the core libraries are indeed much larger than a standard Lua interpreter + the core libraries. I don't have footprint figures for the former, but the latter is usually said to require ~100 KB, give or take a factor of two depending on the platform.
At ~80 KB, my forward-ported, optimized version of an old, partial port of Lua 5.0.x to TI-68k/AMS made by someone else, is in that ballpark. It's missing support for stdin/stdout/stderr (those were never implemented for AMS), time/clock/date, and locales (bad for footprint), but standard file streams and time/clock/date would be far from doubling the size. At least, it can read and write files, among other features available from io.* and os.*.

* there's python-on-a-chip (p14p), which aims at making slimmed-down, special-purpose, library-less interpreters for a subset of Python. The base interpreter is something like 35 KB for TI-68k/AMS, embedded into each program. There's support for interactive debugging through whatever can be used as a serial port, but even after adding a subset of the standard library and for feeding scripts to the interpreter, I think it would remain too narrow for calculator manufacturers to base something on.
(03-10-2014 01:25 AM)Stefan Wrote: [ -> ]Why not use something more established and still comparably easy like Python, Pascal, Ruby etc?

I'm sure this doesn't answer your question but I don't think HP's traditional calculator customer (which the Prime was anyway not targeted at) wants any of those scripting languages anywhere near his calculator. I know I don't.

There are already small tablets and even handheld computers to run that stuff on. What the traditional HP calculator buyer wants is a high performance programmable numerical platform based on RPN/RPL. RPL, which is very close to Forth, is about the best possible OS and language combination for an embedded device like a calculator. To paraphrase, RPN and RPL are what make time travel possible.

Do you really want to key in significant Python, Pascal, or Ruby programs with a non-QWERTY keyboard? RPL works so well because the same operations that are assigned to keys can be pasted into RPL code in PGM mode. That will never be true of any of those scripting languages.

A calculator is not a general purpose computing platform. HP has been selling handhelds and small tablets. To differentiate things enough that a calculator retains any meaning at all, means it has to be a calculator, above all else. Otherwise, what's the point? Just buy a cellphone app.

God forbid that calculators degenerate into nothing more than tiny Linux boxes!
Something not mentioned yet is memory fragmentation. Most scripting languages allocate and deallocate memory fairly naïvely even though they garbage collect. Lua is definitely in this camp, I think Python is too but don't remember for certain. Not compacting memory will result in fragmentation long term. A permanently on device simply cannot fragment memory -- you'll run out eventually. A calculator is permanently on -- you can't wait for it to boot every time you press the ON button, it has to come up instantly. This is the reason for the 41's PACKING and the RPL devices garbage collection pauses.

The 34S avoids this by copying large chunks of memory around all too often and keeping memory compacted all the time. This costs but the CPU in the device is fast and memory is small.


Out of interest, we squeezed Python into a 1Mb flash/4Mb RAM device a decade or so back and this included a full Linux kernel and command line support. This is nothing for modern memory sizes.


- Pauli
Just out of curiosity, how does android performs in terms of memory management?
I think memory management is related to OS, not language and also all io aspects belongs to bios. So I don't understand Tim's answer
The OS gives memory out to applications. The applications have to manage their memory themselves. When you use malloc/free in C, it generally grabs a pool of memory from the OS and dishes that out piecemeal.

For a calculator, the application/firmware has to do all the memory management itself.


- Pauli
(03-10-2014 09:08 AM)HP67 Wrote: [ -> ]A calculator is not a general purpose computing platform. HP has been selling handhelds and small tablets. To differentiate things enough that a calculator retains any meaning at all, means it has to be a calculator, above all else. Otherwise, what's the point? Just buy a cellphone app.

Yes, but we are in 2014: the whole concept of advanced (rechargeable) calculators makes little sense. The only advantages a calculator has are ergonomics and dependability. I suspect that basic scientific calculators will be around for decades, but when everybody has a multi-core computer with lots of RAM in their pocket it's just a matter of time that a killer piece of software capable of doing everything else on the go appears. Wolfram Alpha is getting close, even emulators are.

They can survive (and thrive) because of the educational lock-in. Somehow calculator companies have been successful in convincing people that for high school and maybe a couple of college courses calculators are an effective way to teach Mathematics, they are not (if they were students just would get better at it), but they make so much easy the life of mediocre teachers that they'll probably stay for a while. (And then there are the exam policies requiring crippled devices... it's just broken and sad.) Imagine that electronic dictionaries were compulsory at school, that's more or less the situation.

Slide rules weren't obsoleted by better slide rules, it took the electronic calculator, which really was an idea from the semiconductor companies in order to sell more ICs, yet it became something useful and then successful.

Now, if we were thinking about a way to evolve the advanced calculator from the 90s (which really pre-dates the widespread home computer revolution) into something meaningful in the 20s, maybe there's room for that.

There is demand for a cheap programmable device with standard IO capabilities and low power requirements, think about the Raspberry Pi. A standard development environment is a must.

Think about calculators in the electronics lab. Why not an oscilloscope module?

And for doing Maths, the only thing I miss in a computer is a dedicated keyboard. A calculator should be a piece within a computing environment, not a totally isolated one in itself. I should be able to share a calculator session with my computer when I'm done. I should be able to open an Excel file in the calculator if I'm going to do some statistics there. What about a Matlab friendly calculator?

My guess is that when a school-oriented tablet comes along all these niche calculators that we are talking about will be dead.
Even if schools no longer required calculators, they would still hold a niche market. It doesn't matter how fast these mobile devices get, how fancy their screens are, and how cheap they can drop. The fact that there are some folks who absolutely hate many keys (e.g. note the demise of various Blackberry devices) and there are those who absolutely have to have dedicated keys for efficiency means there will always be calculators around. I for one hate phones that have buttons -- it generally means the phone is thicker than is necessary.
Quote:Yes, but we are in 2014: the whole concept of advanced (rechargeable) calculators makes little sense. The only advantages a calculator has are ergonomics and dependability. I suspect that basic scientific calculators will be around for decades, but when everybody has a multi-core computer with lots of RAM in their pocket it's just a matter of time that a killer piece of software capable of doing everything else on the go appears. Wolfram Alpha is getting close, even emulators are.

They can survive (and thrive) because of the educational lock-in. Somehow calculator companies have been successful in convincing people that for high school and maybe a couple of college courses calculators are an effective way to teach Mathematics, they are not (if they were students just would get better at it), but they make so much easy the life of mediocre teachers that they'll probably stay for a while. (And then there are the exam policies requiring crippled devices... it's just broken and sad.) Imagine that electronic dictionaries were compulsory at school, that's more or less the situation.
Agreed, the laughable computing power and functionality of calculators is one of the indications of the failure that the education markets are, from bottom to top. A combination of lobbying, inertia, stupid regulations, parents' will to buy the best tools (even at gold price) to one's children, and other factors.

In the calculator market, the state of the art for computing power is currently mostly defined by the Prime, due to its 400 MHz ARM9 CPU and 256 MB of Flash, even though it only has 32 MB of RAM, while the Nspire CX has had 64 MB since 2011.
In the real world for modern computing, for $100 (two thirds of the price tag of a Prime / Nspire CX CAS), making a calculator whose hardware characteristics stink less (and as a result, where it is easier to implement faster algorithms which require more RAM, or rely even more on hardware acceleration for e.g. the UI) is possible (trivial ?):
* dual-core Cortex-A7 processors and touch screens far larger than the Prime's are the norm in $100 smartphones, and there's a $25 Firefox phone with a 1 GHz Cortex-A5 + 1 GB RAM;
* the $25 Raspberry Pi Model A uses an ARM11, with twice the clock frequency and 8x the amount of RAM that the Prime has; the slightly more expensive devices such as $35 Raspberry Pi Model B (ARM11), $45 BeagleBone Black (single-core Cortex-A8, 512 MB RAM, 2 GB Flash), $60 Cubieboard 2 (dual-core Cortex-A7, 1 GB RAM, 4 GB Flash), $65/$59 ODROID-U3 (quad-core cortex-A9, 2 GB RAM, no integrated Flash but a 16 GB micro-SD card or eMMC card is inexpensive) are better yet.

Quote:Even if schools no longer required calculators, they would still hold a niche market. [...]
Agreed as well Smile
It's just a matter of making their hardware characteristics stink less on the high-end, and brush up / make dirt cheap the low-end as well.
(03-10-2014 10:30 PM)Manolo Sobrino Wrote: [ -> ]
(03-10-2014 09:08 AM)HP67 Wrote: [ -> ]A calculator is not a general purpose computing platform. HP has been selling handhelds and small tablets. To differentiate things enough that a calculator retains any meaning at all, means it has to be a calculator, above all else. Otherwise, what's the point? Just buy a cellphone app.

Yes, but we are in 2014: the whole concept of advanced (rechargeable) calculators makes little sense. The only advantages a calculator has are ergonomics and dependability. I suspect that basic scientific calculators will be around for decades, but when everybody has a multi-core computer with lots of RAM in their pocket it's just a matter of time that a killer piece of software capable of doing everything else on the go appears. Wolfram Alpha is getting close, even emulators are.

This discussion has come up, and the consensus (at least here on The Museum of HP Calculators forums) seems to be that we want calculators, not smartphone apps. Calculators, not iPads. Calculators, and not pocket computers. That's kind of the whole point. We like calculators. Yes, we realize that most people don't want calculators. But those kinds of people don't normally sign up here and post comments like that.

Are ergonomics and dependability such trivial things?

(03-10-2014 10:30 PM)Manolo Sobrino Wrote: [ -> ]They can survive (and thrive) because of the educational lock-in. Somehow calculator companies have been successful in convincing people that for high school and maybe a couple of college courses calculators are an effective way to teach Mathematics, they are not (if they were students just would get better at it), but they make so much easy the life of mediocre teachers that they'll probably stay for a while. (And then there are the exam policies requiring crippled devices... it's just broken and sad.)

Yes, but HP has never had anything close to lock-in in the education sector. TI won there, and no, we still don't care. HP has lock-in with engineers and scientists, surveyors, and other areas. People in those groups still use HP calculators every day, even though we also sit in front of PCs, carry smartphones, etc.

(03-10-2014 10:30 PM)Manolo Sobrino Wrote: [ -> ]And for doing Maths, the only thing I miss in a computer is a dedicated keyboard. A calculator should be a piece within a computing environment, not a totally isolated one in itself. I should be able to share a calculator session with my computer when I'm done. I should be able to open an Excel file in the calculator if I'm going to do some statistics there. What about a Matlab friendly calculator?

You will probably get that from TI if they don't already offer it. HP may offer it too at some point. I have no idea. But I do know the people who have bought HP calculators all these years don't have the same priorities you do because the people who have always chosen to buy HP calculators just don't care about this stuff.

(03-10-2014 10:30 PM)Manolo Sobrino Wrote: [ -> ]My guess is that when a school-oriented tablet comes along all these niche calculators that we are talking about will be dead.

I don't agree with this and I really don't understand these comments in this forum.
(03-11-2014 01:23 AM)Han Wrote: [ -> ]The fact that there are some folks who absolutely hate many keys (e.g. note the demise of various Blackberry devices)

BlackBerry is not dead, but it is badly maimed. But you should know, it's the people who want their phone to replace their Windows PC who caused it (along with some bad management, no doubt). BlackBerry is a good phone. And it's the best portable email device, bar none. The factors pushing BlackBerry out are very similar to the factors pushing calculators out. It's people's changing expectations and desire to consolidate and the simple fact that the latest smartphone is a status symbol and glamor item, because most of those hi-spec phones are not good phones at all. It seems dedicated devices have always been better than one do-it-all device that really doesn't. This is the strength of HP calculators, and calculators in general: provide a platform that does one thing well.

(03-11-2014 01:23 AM)Han Wrote: [ -> ]and there are those who absolutely have to have dedicated keys for efficiency means there will always be calculators around.

Above you just said BlackBerry died because it had keys but now you seem to be saying some people must have keys for efficiency. Therefore, the demise of BlackBerry is because of efficiency? Perhaps I agree with your conclusion, but not for the same reasons as you Wink
(03-11-2014 07:48 AM)debrouxl Wrote: [ -> ]It's just a matter of making their hardware characteristics stink less on the high-end, and brush up / make dirt cheap the low-end as well.

I suppose it's getting harder to tell but HP hardware was always better than mass market junk, which is what RPi and Beagle arguably are.

I hear you on the fact that calculator hardware is no longer state of the art and is expensive compared to other portable devices, but we don't need that kind of power nor the power consumption that comes with it, nor the lousy build quality that comes with it.

That's kind of exactly the point. We don't need a 400 MHz ARM calculator. And anybody who thinks we do need one thinks that way because a 1 GHz single core phone is now old-tech and you wouldn't be caught dead with one. But we're not talking about "phones" that are supposed to be able to play HQ video, and video games, and surf the web.

Good engineering used to be about sane limits and delivering function with correctness, reliability, good materials, and some amount of finesse, as opposed to today's "answer" which seems to be throwing as much hardware and generic software you can at the problem.

Tim Wessman said they needed 5MB for a font on the Prime. That puts devices like the HP 48 in a whole new light, doesn't it? Wink
Quote:I suppose it's getting harder to tell but HP hardware was always better than mass market junk, which is what RPi and Beagle arguably are.
When more than a couple million people buy "junk" and get used to it - and that's before sub-50$ smartphones sell at dozen million, if not hundred million, volume, as this previously untapped market segment has excellent forecasts - manufacturers of other device families may want to notice and plan ahead, because something is definitely going on.
Even if we know that calculator manufacturers have enough lobbying power and teacher following to keep exam regulations silly, features low and prices high for a longer period of time.

Quote:I hear you on the fact that calculator hardware is no longer state of the art and is expensive compared to other portable devices, but we don't need that kind of power nor the power consumption that comes with it
Using newer components doesn't necessarily raise power consumption, thanks to increased power efficiency offered by newer chip technology.
http://www.arm.com/products/processors/c...tex-a5.php indicates that the Cortex-A5 has lower dynamic power per MHz (and that's using a 65 nm process of years back, whereas nowadays' leading edge for smartphones and tablets is 28 or 22 nm), and each MHz gets more work done on a Cortex-A5 than on an ARM926, thanks to expanded instruction set and better micro-architecture.

As for throwing more hardware at the problem because there's not enough time to work on optimization... while philosophically unsatisfying, it's the way the real world, with insufficient time to market and counter-productive management decisions (I can't imagine the crazy XML bloat used by the Nspire not being made on purpose), works.
As a hobbyist, I used to spend lots of time reverse-engineering and optimizing stuff so as to get more stuff done on limited hardware resources (mainly the TI-68k series), and I still do to a lower extent. Few professional software developers can do that.

The fact that a calculator is supposed to be used as a calculator, does not mean its feature set shouldn't be expanded to whatever purpose users see fit (no, not just games), or just for fun / "just because we can".
I once used my TI-89T as a USB keyboard + mouse for the real-world, day job purposes of performing initial setup of an embedded ARM board which only had a female mini-A USB plug, before we bought a male mini-A / female A cable (which came in only weeks later).
Even though there are better and cheaper alternatives (though few have a full keyboard, a screen and a battery), the Nspire can run Linux (and the Prime would if people were more interested in it / had more time to work on it), and can therefore be used for real-world non-teaching purposes.
(03-11-2014 10:08 AM)HP67 Wrote: [ -> ]I don't agree with this and I really don't understand these comments in this forum.

The truth is I never really expected you to understand them. You talk about the lock-in with engineers and scientists. I don't know which scientists are you talking about. I spent last November at CERN and I didn't see a calculator. I only saw MacBooks... You don't like that, too bad. I'm sorry but this is not 1979.

I love calculators, I just would like them to survive. I could go on and try to have a discussion, but you just really want collector pieces, that's fine. Besides, I don't feel like asking for your approval to post here. Have a nice day.
(03-11-2014 10:08 AM)HP67 Wrote: [ -> ][...]HP has lock-in with engineers and scientists, surveyors, and other areas. People in those groups still use HP calculators every day, even though we also sit in front of PCs, carry smartphones, etc.[...]

I have to agree with Manolo here: In all my time in school, university and working in development departments of different companies I have seen exactly 4 people using HP calculators. 2 of them are very likely pensioned by now. 3 of them were physics teachers/professors, 1 engineer. I really wouldn't call that a lock-in ^^.

Regarding the point that something like python would be ressource hungry: If you take the the anaconda scientific python distribution as example its 1.6GB. Ok that is really a lot. But I mean the Anaconda distribution probably includes everything one could imagine, and 70-90% of the stuff one wouldn't need on a portable calculator. But also: What is 2GB storage nowadays? As a consumer you can't even buy such small storage sizes anymore :-D (or at least you have to look really hard).

I don't understand the point that a higher powered processor would reduce the build quality of the calculator. Why should it?

To the point that a standard language would have been adapted too much so that in the end it wouldn't be the same standard language anymore: I'd say the main reason for TI to modify the Lua scriptiting capabilites were that direct file IO and OS functions could open unwanted doors to circumvent their security features (which is not desired by TI).
For a embedded device one probably would have to write some classes for the user interface, which is of course different from a PC. But since Python doesn't really come with a standard way for GUIs that wouldn't make a big difference in the end. I can run Python code, which doesn't use any GUI features, on my phone pretty much unaltered.

I also didn't meant to say that HP PPL is hard to learn. It's really easy.

Finally: Thanks for the comments everyone. But please don't start a flame war :-)
If I understand correctly, your experience seems to be mostly in academia, while I was talking about industry and the public works and commercial sectors.

In my experience in those areas, it's been common to see civil engineers and surveyors with HP calculators, and programmers with HP calculators. Since there hasn't been much going on in new products in the calculator world, an HP 48 is the usual suspect in those environments. They're still perfectly useful today.

And anyway, my use of the phrase "lock in" was in response to the erroneous statement in the thread that HP has lock in because of the education market. Nobody who knows about HP would claim such a thing. If HP has any lock in, it's in engineering, etc. Prime is all about trying to break into the education market.
I also wanted to comment on the ergonomics:
That is my personal most important reason why I prefer a calculator for not too complex stuff (at some point it gets easier to work on a big screen again). Its easier to hack in the equations with the special keyboard that a calculator provides.
However: The Prime is a pretty bad example for good ergonomics. That starts with the unreadable labels with the keys, continues with the way how already typed equations can be modified (say you've typed 1+2*3 and you want (1+2)*3, or even worse: 1/(1+2)), and ends with bad documentation (which IMO is also a part of ergonomics).

Maybe there is a market for calculator-like hardware keyboards for smartphones ;-)
Then we are back to calculator apps running on a BlackBerry with a physical keyboard Wink

Does the Prime require you to use the touchscreen? I mean, can everything be done with the keyboard and the touch screen can be used optionally, or does it require that some things are only possible with the touch screen?
Pages: 1 2
Reference URL's