[Pharo-project] Pharo for iOS

John McIntosh johnmci at smalltalkconsulting.com
Thu Oct 27 05:34:51 CEST 2011

Well this is an old note, but I thought I'd answer it.

You can download, install and run the Scratch.app
This is not the closure VM, but does have the Open/GL canvas, or you can
choose to use the alternate canvas which is based on CALayers.

Now about building apps on iOS.

You can choose to either
(a) run the VM and show the squeak desktop which I did for Blob and Swirl,
these being experimental early toys mostly to track the stability of the VM
as Apple sends developers crash reports if there are enough generated.

(b) run the VM and show a Cocoa UI, do all work via Smalltalk, Both the
Fractions Calculators and WIkiServers do that. This  is hard because getting
a walk back means setting up  VNC so you can control things, and using proxy
and callbacks to do work in Smalltalk code is hard to debug and code, plus
you need to pass in all these constants to Alien or FFI which you gleam from
the apple header files. Bad things happen when you deadlock between the VM
and iOS callbacks.

(c) run a cocoa app and use the VM as a subprocess to be the Model, where
the View and Controller is all Objective-C.  Which is mostly how the
Scratch.app is designed.  We give taps, keyboard, load this project, and
stop/go to the VM as a result of interacting with cocoa controls. The VM in
turn mostly provides audio and frame updates.

Oh and I"m not sure about the JIT stuff, pre 3.2 making a virtual memory
page executable was not allowed by non-root apps. But in post 3.2 it seems
they added some extra mmap keywords

#define PROT_EXEC 0x04 /* [MC2] pages can be executed */

#define MAP_JIT 0x0800 /* Allocate a region that will be used for JIT
purposes */

Obviously someone could try it...

On Fri, Sep 23, 2011 at 12:41 PM, Pat Maddox <patmaddox at me.com> wrote:

> sweet! where can I find instructions on how to do this too?
> On Sep 22, 2011, at 4:37 AM, Alexandre Bergel wrote:
> > I have Pharo running on my ipad.
> > I just followed instruction of Bert and it works like a charm. This is
> not accesible via itune however, but, it is perfectly okay to have pharo
> applications on it. John has a couple of them
> >
> > Alexandre
> >
> >
> > On 22 Sep 2011, at 06:46, Dennis Schetinin wrote:
> >
> >> What is the state of the art and nearest perspectives of using
> Pharo/Squea (or maybe some other Smalltalk implementation) for iOS
> development? And does Apple officially allow to Smalltalk-based
> applications?
> >>
> >> --
> >> Dennis Schetinin
> >
> > --
> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> > Alexandre Bergel  http://www.bergel.eu
> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >
> >
> >
> >
> >
> >

John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20111026/b2f15afe/attachment.htm>

More information about the Pharo-project mailing list