Math software, dynamic languages, and the iPad

Print Friendly, PDF & Email
Rate this post

Will issues around multitasking and the new restrictions on the use of dynamic languages stop the Apple iPad from being used as a serious device for mathematical and scientific software?

Several days ago I did a blog post about how math software might be able to take advantage of tablets like the iPad that are now hitting the market. I spoke about some of the classical systems like Maple and Mathematica, as well as the one with which I was involved, Axiom.

If they were so inclined, it would be more possible to port the first two to the iPad than Axiom and systems like it because they are largely self-contained and are written in C or C++ (I believe). This means that they won’t automatically go afoul of Apple’s new modified clause 3.3.1 in their terms of service:

3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

Also see this 37signals entry on some complaints about the new 3.3.1 and Larry O’Brien’s “The Absurdity of Apple’s New iPhone Restrictions”.

While a lot of the attention has been on Adobe’s new cross-compiler and Java, this also evidently rules out using dynamic languages like Python and Scheme unless somehow, someway, things get translated into a binary that is completely indistinguishable from code as created as described in 3.3.1.

Axiom is written in Lisp and so that gets tossed in the waste bin. Note that Axiom is a huge system and a rather old one at this point, so I’m not saying that anyone would really want to port it to the iPad, but now we know they shouldn’t even bother.

Mathematical software for symbolic computation manipulates expressions that can get quite big, such as 21000:

Even worse are large polynomials and matrices. When you start calculating with them, many intermediate results can be produced and memory efficiency becomes very important.

Though you still have to have a good strategy around destructive and non-destructive object operations, with languages like Python, Java, and Scheme, you get built-in garbage collection. This is not true with C++ in general and while Objective-C now does have it on the Mac, it does not have it for the iPhone and iPad.

Also, Python and Scheme have bignums, those arbitrarily large integers like the one above that makes it easier to do calculations. (I know there are packages for other languages and interested readers should certainly look at GMP, the GNU MP Bignum Package for C and C++).

So if I were to write a serious math program for the iPad, one that could do large and sophisticated computations within the memory confines of the device, I would have to worry about linking in a package like GMP (which is GPL) and I would probably need to write some form of garbage collection, or otherwise have a very strict coding philosophy on managing object memory.

The former is very possible, the latter is a total pain in the neck here in 2010. Of course I would want to use Python or perhaps Java for a serious math application. With 3.3.1, that’s not in the cards, at least right now. I might consider other languages for performance reasons, but those would be my first two to consider.

Therefore if you were going to write that great next math app, you probably will want to do it for the Android or another Linux tablet. Will this have similar implications for other types of scientific software? I don’t mean toys for little problems, I mean professional-quality software.

While we’re at it, multitasking on any of these devices will be very important (once the iPad gets it later this year). No, don’t stop working on that big calculation and no, don’t kill my app because I’ve been doing other things. Will issues around the way tablets do multitasking keep serious math software off these new little gadgets?

Also see: