Mars/Deimos next year agenda
This is a roadmap of what I want to achieve next months: (allowed by the ESUG sponsorship)
Deimos 1.0
We need an usable (for others besides me) version of the iPhone part of Mars. There are still several pending issues needed in order to be able to “take over the iphone”:
Finish basic controls. Most of the UI controls are already mapped, but there are still some other very need who are absent today.
Finish events. Basic events are already mapped and can be handled nice from Pharo. But there are other complex events who are still missing.
Explore “declarative style”., instead using NIB’s. Use bundles instead main program. I want to allow users to not-compile the vm every time they want to introduce a change on it’s programs.
Optimization and stabilization. Currently the vm has some inestability issues, maybe caused for the code inside the image (on using a bridge, there are always some interaction issues to handle). Also, there are a lot of space for optimization of controls, interactions, etc.
Prepare a “production” image. Using Pavel’s PharoKernel.
Mars 1.0
There are several tasks needed here:
- Redesign bootstrap mechanism
- Redesign event handler mechanism (maybe using the same as #Deimos for a first approach)
- Redesign layout mechanism.
- Finish the migration of widgets (using ObjectiveCBridge)
Mars Tools 1.0
The first release of Mars Tools were based on OB. There were a lot of movement here, and now I need to investigate possible new approaches: ToolBuilder. ToolBuilder seems to be very old and unmantained. Also, the resulting tools looks old and not with the quality needed on a modern tool.
OB This is the “default” modern tool implementation, but it has some design problems (from my point of view) and is also a bit coupled with the code.
Glamour This is a replacement for OB, maybe the future for Pharo browsers... but is still unstable and incomplete.
None of this (home made tool builder) Well... this is not the best approach (and I don’t really think I will do something like this), but at least, I have to take it into account as a possibility.
Then, I want to achieve two objectives:
- Build basic tools (Workspace, Transcript, Inspector, Browser, Debugger)
- Build a Mars based image without Morphic nor MVC (maybe based on PharoKernel)
ESUG sponsorship approved for Mars/Deimos!
This week I submitted a request to ESUG looking for some kind of sponsorship. I wanted the possibility to spare time to finish a first version of Mars/Deimos in the course of the next year. Gladly, the ESUG board accepted my request yesterday :)
Now I have a lot of work to do, in order to present my “plan of operations” and to achieve it. In next post I will present my agenda, but I do want to use this space to say: Thank you very much ESUG!
Deimos talk at Smalltalks 2009
Last week I went to Smalltalks’09 and talked about Deimos. The presentation was good, althought my spoken english is not good at all (I need to improve that area, and is on the “todo” list for 2010). I talked a little about the internal design and also the API of Deimos, bur of course the best part was when I showed a small example and changed it on the fly, programing inside the iPhone simulator! (I used RFB).
The slides for the presentation can be seen here.
So, what about the future of Deimos? Currently I’m working on speeding up and stabilizing the system. So, stay tuned I will release a new version very soon!
"Hello, World" with Deimos
Deimos is a Mars sub-framework to build iPhone native applications. I’m going to show you a tipical “Hello, World” using it.


Download and run!
This example can be downloaded here.
You just need to download it, open the project with XCode and execute it (a simple cmd+R).
If you want the step-by-step, you can follow this instructions:
Prerequisites
XCode project
- You need to have an XCode for iPhone installed on your mac.
- You need to download iSqueak sources, using SVN: http://svn.isqueak.org/vm/. The project runs “out-of-the-box”.
- You need to replace iPhone.image and iPhone.changes for the latest PharoCore image (491, right now)
- You will need to add PharoV10.sources to the xcode project
iPhone image
- Prepare the image, load the metacello configuration, with this script:
Gofer new
squeaksource: 'Mars';
addPackage: 'DeimosConfiguration';
load.
DeimosConfiguration loadLatestVersion.
Step 1. Creating a View NIB (ObjectiveC side)
This section is dificult to understand if you don’t know anything about Cocoa programming. If that is the case, please, email me and I will be glad to explain in detail this steps and point you at the right direction.
- Create a new view called “HelloWorldView”. And open the UI builder.
- Drag a button into the center of the view and label it “Press me”.
- Assign "10" to button property "tag"
- Change the NIB first responder class for “UIViewController”, and then associate "First Controller" with current View
Step 2. Creating a Deimos application (Pharo side)
This is the section we are most exited to show you!
First, we need to create a DEView subclass:
DEView subclass: #HelloWorldView
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'DeimosExamples-HelloWorld'
Then, we need to define three methods:
createViewDefinition
“I define the method definition ObjectiveC controller class”
^DEViewDefinition nib: 'HelloWorldView'
helloButton
“I answer a reference to helloButton outlet (in a DeimosWidget object)”
^self widgetTagAt: 10
initializeContents
self helloButton
onTouchUpInside: [ self inform: 'Hello, World!' ].
Now, we need to register HelloWorldView as an active application, just execute in a workspace:
HelloWorldView register.
And now, just run it!
Final notes
Of course, this is just the easiest example possible... in other posts I will be showing more complex examples.
If you want to participate in Mars/Deimos development or just use it:
Deimos, as Mars, is a work-in-progress, please, feel free to contribute by using it, making observations and of course, with code!
Talk about Deimos on Smalltalks'09
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:
Smalltalk in the pocket: building applications for the iPhone
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.