[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
[coco8] JSCocoa Interface
We access native resources (ObjectiveC objects and C functions) from S8 side using an API implemented in ObjectiveC and assembly (for FFI calls).
We implement ObjectiveC subclasses in S8 inheriting from NSObject.
When the system launch the subclasses of Coco8Implementation will try to find a native class (on ObjectiveC side) with the same name.
- If the class is found the class will help to instantiate wrappers to instances of native class and also provide messages to instantiate native objects from S8 side.
- If the native class is not present, the S8 class build a new native class (in ObjectiveC space) that implements the interface provided by class side method for #implementation. This mechanism let us implement classes from Smalltalk side that are bound dynamically at startup or at any time the system needs to create new classes on native space.
It is also read from XML file a set of symbols that area accessible to the s8 system from executable(C structures, functions and constants).
Coco8 platform now runs on iOS (32&64bits) and OSX (see xcode project s8sx).
The first releases of coco8 app embedded a custom version of the JSC library.
When Apple started promoting the use of the JSC library as a library for dynamic linking, we bound the application to the library dynamically and removed the old library from project.
The coco8 platform has grown on S8 side as usual, by iteration and incremental addition of features and bindings to iOS.
We reported the bug to WebKit project.