Next thursday (Nov 19), I will be talking about my progress on iPhone development at Smalltalks'09!
Deimos is my last effort to integrate Pharo into the iPhone OS, and a necessary step on the way to integrate it with OSX.
I will talk about the design of the proto-framework, but a lot about the problems found developing for the iPhone and the answers, this is the abstract I sent to the organization:
Abstract Bring Smalltalk into new technologies is always a hard but exciting job. In this talk we take another step from those already made, and we walk one of the possible approaches to build iPhone applications using Pharo.
Explanation Right since the introduction of the iPhone, John McIntosh built a SqueakVM compatible with the new architecture, called iSqueak. With this VM, we were able to load a Squeak/Pharo image into the iPhone, and run some applications, specially the “eToys”. Along with the VM, there was a plugin developed to allow direct communication with platform objects, the ObjectiveCBridge. With the bridge, we can create and manipulate objects of the “CocoaTouch” (the API for building native iPhone applications) inside a Pharo image. There are some applications in the Apple Store made with just this two elements: the VM and the bridge. But we detect a major problem on following this approach: it “feels” very far away from Smalltalk, you need to code a lot like ObjectiveC (even with Smalltalk syntax), and you need to take care about all the aspects of the bridge: manage the creation and disposing objects, and plug the callbacks as special objects. Also, we need several objects created on ObjectiveC for support reasons. We want to take this frameworks to the next level and create a framework for build iPhone applications using as much Smalltalk as we can (even 100% if possible), and using a known development metaphor. For this, we create “Deimos”, a Model-View-Controller framework to interact with the hard part of the communication with the CocoaTouch API. This framework lets the “View” part handled (and created) by NIB objects (the Cocoa UI generated objects using the UI Builder), the “Controller” is a mix between ObjectiveC objects and Pharo objects, with all the possible code in Pharo, and all the “Model” in Pharo. We take care about the object creation/destroy process and the plug work... you just need to declare it.
Conclusions This work allow us to quickly create iPhone applications, using the advantages of the UIBuilder and the goodness of a Smalltalk environment. But we think there are still some drawbacks: you still needs to make some code “outside” the environment... fix this problem is the content of our near-future work.
For those interested, I will be uploading the slides of the presentation as soon as possible.
Leave your comment