Programming on an iPhone

Hi, I've released an app for writing OpenGL fragment shaders, while on the train or somewhere else without a computer nearby.

Paragraf

Since Apple's policy for writing script languages for the iPhone, it's hard to write your own language. A strange policy. Anyway I found one language with a compiler already on the phone. Do any of you write code on your mobile devices? What tools are available? This app is only for graphical experimentation and modifying the camera stream and images, so it's a bit limited.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Squeak

I don't yet write code on my Android and iOS devices, but from the prototypes that I've seen of Squeak on both those platforms, I can imagine that it could be a very pleasant experience indeed.

Nu

I don't write for iPhone myself, but I do use Nu, a Lisp which is apparently well suited to the iPhone. See http://programming.nu.

Paragraf

Very nice! I installed it right away. I look forward to learning how to write fragment shaders ;-)

Frink for Android

My programming language Frink is available for Android devices. Frink is available from the Android Market.

The only reason Frink is not available for iPhone is that Apple prevents and rejects *any* programming languages (or any program that can download "executable" content from the interwebs) by Apple's ridiculous license restrictions. (Unless, supposedly, you pay them a ton of money.) This is also why they restrict Java. This argument, of course, is a red herring, as Java's flawed security model was designed to allow or disallow such things from day one. Blame Apple management weasels for limiting your options based on flawed premises.

This is why anyone who cares about programming (or even performing interesting calculations that require a loop) on a device that they've purchased and that they own should immediately reject all Apple devices.

I worked hard to make Frink programs work equivalently on JVM and Dalvik, and you can write programs that will work on Mac, Linux, Windows, Android, and other platforms that run Java 1.1 or later. Swing or AWT. Even the graphics library will work on all of these platforms.

Frink works in both programming mode and as an interactive calculator that tracks units of measure through all calculations. It also has a symbolic transformation engine which allows you to do symbolic algebra, calculus, etc. even on your handheld device.

Are you doing anything in

Are you doing anything in Frink to optimize for touch input?

x-ref

cf. Programming with Touch? [ltu node].

Relevant, although I think

Relevant, although I think programming on the iPad is a separate question from programming on the iPhone. Programming on a pad could be an planned/intensive experience, while programming on a phone would probably be a more spontaneous experience. For example, you need to do some calculations in the field and build an appropriate small program on your phone without going back to the office. A pad could work also, but the phone will always be with you while your pad might not be.

tablet programming experience

I can easily imagine tablets being used for spontaneous programming in an augmented reality context, integrating with ambient devices. I'd really like the ability to point your video camera at an iRobot Roomba, combine that with distributed feature matching services and ambient discovery protocols, and start controlling it by touching the video and dragging the Roomba or hooking it to a control program. (This is tough since you need to associate a video image of a Roomba with the virtual device, with minimal risk of ambiguity.)

I also imagine tablets would be excellent for mathematics and data visualization. One might tweak calculus expressions with a pen, watch changes in 3D graphs. For data, one might tweak queries and the visual transforms.

I'm interested in the 'audio' variation of visualization, too, such as turning video or mathematical graphs into sound. I imagine creating a programmable kaleidoscope filter for webcam, then piping that to the video-to-sound application. But to achieve this, while allowing separate development of the kaleidoscope and video-to-sound apps, we need to move away from Apple's philosophy that each app is essentially its own world. It is really necessary that we present apps as user-programmable objects.

The UI becomes a simplistic IDE, perhaps offering ability to peek under-the-hood so that you can mashup apps by composing small chunks of this app with small chunks of that one. There is a whole arena of programmable e-toys and e-instruments, and tablets seem like nice platform for them.

Can't touch this

Frink doesn't do anything with touch at all. In fact, I haven't yet designed its system for asynchronous event-driven programs.

Since I always intend for any Frink program to be able to run on any device (including Swing, AWT and Android interfaces,) it will take plenty of work to make a cross-platform, multi-resolution event-driven environment.

I'm really not a fan of attempting to program by pointing and clicking, (or touching and dragging) in any case.

mouse != touch

You definitely have to be creative about it if you attempt to move into that space. Also...

mouse input != direct touch input

You don't point and click with touch. You just touch. There was an early paper by Karat (in '84 I think) who talks about how mouse input is way less inefficient than direct touch input. There is a lot to consider before we have "real programming" on an iPhone, its not just about getting a compiler on there.

Where's my stylus?

There was an early paper by Karat (in '84 I think) who talks about how mouse input is way less inefficient than direct touch input.

Not having read the paper, I think this needs to be qualified. It's not hard to imagine that for selecting small items, mouse (or stylus) are more efficient than fingers.

Yes, target size is

Yes, target size is important. You want to make your targets extra big when accommodating touch, so there is a tradeoff and we aren't talking about existing mouse apps here. If you go beyond selection, the mouse (and stylus to some extent) still will be better at precision placement.

Jailbreak!

You can legally jailbreak an iPhone and deploy that way. You won't be distributing through the iTunes app store, though, so your audience will be more limited.

I'm quite tempted to do this - albeit, for an iPad instead of the phone. iPad is, frankly, an awesome platform for augmented reality and command-and-control software (with its microphone, accelerometers, rear-facing camera, touch sensitivity, long battery life). It could be a bit better (rear stereo-cam for building a 3D world model would be awesome) but this is among the best commercial device for my interest areas today.

I'm having to weigh my irritation with Apple's licensing against the relative quality of their hardware and battery life. So far, the hardware is winning.

You could also deploy your

You could also deploy your app to iPad developers who have paid their $99 registration and can hence load their own code (and maybe yours) onto it, although I have no idea if that is kosher with the developer licensing agreement.

The Android tablets (e.g., Xoom) are also reasonable and will probably be more open given Google's philosophy (though maybe not moto's philosophy). And then...you could always try a Windows Tablet, hardware isn't great, but development tools are there and you can begin prototyping and developing your great tablet ideas.

For the record, I own an HP EliteBook with multi-touch to do my language work: it's like an iPad, but heavier with less battery life, and touch performance isn't that great. I also just bought an iPad, but that is more to get experience with other touch apps then to do any development (considering who my employer is). And who knows what 2012 will bring, let's hope for something good.

Developer License

Apparently you're limited to 100 devices using the developer license. And I'm not sure how much that license will restrict your rights - i.e. it might be that developing a language platform under the developer license or on their SDK is a breach of agreement. In that case, you'd be better off (legally) by jailbreaking.

Xoom is very competitive, I agree, even with 75% video battery life and 33% more weight than iPad 2. (It makes up for that, somewhat, with a bigger screen and higher resolution.) However, a particular limitation kills it for me: it only tracks 2 fingers, making it unsuitable for a variety of interesting applications, and reviews say it isn't as precise as iPad's tracking. (cf. iPad tracks 11 fingers, iPhone tracks 6; I guess they're prepared for Count Tyrone Rugen.) I'll see what happens in future releases.

iPad tracks 11 fingers,

iPad tracks 11 fingers, iPhone tracks 6; I guess they're prepared for Count Tyrone Rugen.

or 10 fingers + nose. For some games, this can already come handy.

two paws and some whiskers

Let's not forget the iPad games designed specifically to keep cats entertained. Then its two paws and whatever else the cat uses to swat the mouse, that could probably be done on a Zoom though.

Surface 2 should be really interesting, supposedly it will probably support as many touch points as needed given that the cameras are built into each pixel.

Jailbreaking isn't enough.

Frink runs on the JVM, so unless the Apple management decide to allow someone to distribute a JVM on the iPad/iPhone/iPod, then I'd have to build and distribute one of those also before Frink can run, which I probably can't do legally.

What about dalvik and

What about dalvik and Android?

Dalvik and Android

Please see my first post in this thread.

For more information, it was relatively easy to port Frink to run on Android. I'm fairly impressed with Google's tools. (And I'm rarely impressed with tools.) I was able to send my .jar file (compiled with Java) through the Dalvik compiler with little or no modifications, which means over 100,000 lines of code with no changes. I did have to change a couple of places where I made the assumption that a couple of AWT classes (like Color) would always be available, and added about 4000 lines of code for an Android GUI, and ported Frink's graphics library so that it would also support Android's methods for drawing and loading and and modifying images (which are significantly different than AWT or Swing.)

I've always worked hard to make sure that Frink will run on Java 1.1 or later, so porting was very easy.

TouchStudio

TouchStudio From Microsoft looks interesting.

TouchStudio is a new programming environment and language built around this new reality. Its typed, structured programming language is built around the idea of only using a touchscreen as the input device to author code.

Beta version available for Windows 7 Phone.

Nice to see this is finally

Nice to see this is finally public! TouchStudio is definitely going after programming on phone, they have a very interesting model for that.