I learnt two important lessons during an idyllic holiday in Thailand over new year: Firstly I should relax more often, and secondly I should be able to code on my iPad when I am done relaxing. My resolve to relax more evaporated as soon as my fingers touched my keyboard back home, but the realisation that my iPad will never be a computer in my eyes until I can comfortably code on it didn't leave me. The accepted wisdom is that the iPad is a device for content consumption, not content creation, but I want my iPad to be more than an apparatus for donating more money to Apple, and I returned from Thailand on a mission to be able to code on my iPad. I am writing here to reveal my solution.
I discovered in Thailand that the available interpreters were unusable. They use iOS's inbuilt text editing elements, which work great for emails where you type a document from beginning to end with only minimal alterations, but for coding tasks where frequent and disparate minor alterations are expected they are hopeless. If we are to code effectively on our tablet devices, we need editors designed from the start for touchscreen interaction, not editors that are attempting to recreate the familiar keyboard experience on the iPad.
My solution, as you can see in the video above, is to edit the parse tree. Editing source code character by character is a concept wedded to the keyboard and after discarding it, my iPad source code editor came together fast. Rather than manipulating ranges of characters I have built an editor solely focussed on selecting, creating and moving syntax elements.
The first choice for a language to be edited by its parse tree can only be a member of the Lisp family, languages whose syntaxes are identical to their parse tree. Although later I will extend the concept to more mainstream languages, in this project Scheme has played its traditional role of a language perfect for experimentation and development.
TouchScheme is nearing its release day. A product like TouchScheme is necessarily an experiment, and development will continue apace after release. I'm hoping for feedback to guide me while I do this. Feel free to get in contact with me at email@example.com.
Posted on 17 Mar 2012
Slide to code blog is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at http://slidetocode.com/blog/.