[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[objC8] Core semantics

In most S8 platforms boot file is a minimal implementation in native language that defines the minimal structures and functions to construct and start a minimal S8 System.
ObjC8 implement the boot functionality in xcode source files under image subfolder in the source tree. The files will be included in the xcode project and compiled in the final application.

A description of design of boot semantics of objC8 follows.

smalltalk

The root of the system "smalltalk" is defined as a static global in "StSystemDictionary.h".
It will be NULL until the first time [StSystemDictionary instance] is evaluated; returning the sole instance of the StSystemDictionary class.
smalltalk is implemented to respond to launch:with: as a helper to be used when starting the application (see AppDelegate.m)
The class StSystemDictionary implements a set of methods (usually implemented in boot file) to manage internal structures of the S8 System.
Most inlined code will call this methods to implement core behavior of the system running in Objective-c runtime environment.

nil

nil is implemented in StUndefinedObject.h as the sole instance of class StUndefinedObject.
nil is returned evaluating [StUndefinedObject instance].

Methods

Exported methods
Methods are implemented as normal objective-c methods, when the method is contained in the project files or snapshot file (see Snapshot.h+m).
Runtime methods
Uploaded Image: alert.gif: methods instantiated at runtime needs implementation

Classes

Exported classes
ObjC8Exporter define interfaces for S8 classes when generating Snapshot; and dump all methods as objective-c methods defined by the class.
The objective-c class will have the same name as Smalltalk class; except in the cases of well known classes (see ObjC8Exporter>>#objCNameFor:)
Runtime classes
Uploaded Image: alert.gif: classes instantiated at runtime needs implementation
Class model

Snapshot

Snapshot files (Snapshot.h+m) are generated during build from a S8 system running in source native language (e.g. javascript).

System Startup and Application launch

It is suggested that the application initialize and launch "smalltalk" in AppDelegate's application:didFinishLaunchingWithOptions:
Uploaded Image: idea.gifsmalltalk = [StSystemDictionary instance];
return [smalltalk launch: application with: launchOptions];