Projects

(this is all pretty much unsorted thoughts right now. needs to be brought into proper sequence)


What is a project?

In Tweak, projects are the equivalent to applications. They are the basic entity for redistribution combining the user-created content and any resources required by the project. Resources include various things such as:

Note that although we list code separately in the above, it is really nothing special. Just as media data, code might be used "inline" in the project (in which case it would not appear in the resources), and it might be distributed and installed separately (such as when loading a project that requires a library already provided by another project), and the same content-validation and caching rules as for other resources apply.

In other words: Code is just another form of content.


How do projects work?

Projects combine various of the other technologies in Tweak. Since they are fully self-contained they include for example, a script scheduler which handles all the scripts run inside the project. Project can always be run on their own, or they may be loaded into some authoring environment.

To support loading of projects into authoring environments more easily, the authoring environment may associate meta-data with the project. Such meta-data is entirely optional, its presence or absence has absolutely no impact on the project. Equally, the absence or presence of appropriate meta-data should have no impact whatsoever on the ability of an authoring environment to load a project. If an authoring environment cannot deal with the meta data from another authoring environment it should simply ignore it.


Trusted imports

References to system capabilities are provided to the project via so-called "trusted imports". Trusted imports are nothing but a way for the project loader to hand a number of important objects to the project, including:

The above objects are the primary means of a project to interact with the user. Input is received via the event queue provided by the loader, output is generated via the canvas provided by the loader. Various other requests are handled by the powerbox.

Note: A project may not use any other means to interact with the user. While not enforced right now, in the future any attempt to interact with the user by other than the means described here will be seen as viral behavior and the project will be killed immediately.


Project storage

The standard storage format for projects will use the ImageSegment technology developed for Squeak. Image segments represent portions of the object memory that are stored in the same format as images themselves. While basically a generic Squeak technology, there will be some major differences in the way image segments are used in Tweak to give them the same robustness that images have (currently, using image segments in Squeak is an extremely brittle process), including:

In addition to the user content being stored with above technology, resources will be embedded into a zip-like structure for disk storage, or an on-demand project stream for replication.


Significant changes

Here are some significant changes in the relation between objects: