Skip to content

Methods for inter-object communication

Hayley Patton requested to merge methods into master

Methods

This pull request replaces the "message passing" system, where messages are sent from a just-initialized object to some objects by running an initialization script, and then those objects handle them by running message scripts, with a method system, where a method is called on a just-initialized object, which may then call other methods.

This system allows for new protocols to be introduced (such as object presentation) without having to add more script slots, supporting decentral development. It also makes side effects "transactional", only adding them if they are produced on a call chain that does not unwind due to errors.

However, it is marginally (probably 10 to 20%) slower to interpret, but we really should write a dynamic compiler if performance becomes a problem.

Computed values

Computed values no longer store their causes, and it is also possible to remove computed values, making computed values more like a two-phase set, but allowing multiple elements (i.e. a multi-set).

Implementation

The implementation of "named" objects has been greatly simplified, and dead code and features (such as type specifiers, which we do not use) have been removed.

Merge request reports