Changes to be made:
- Change core data type to S-expressions of pair Sexp | natural
- Add
CALLERinstruction (returns the identity of the caller). - Add
CALLDATAinstruction (returns the message sent to this object). - Drop the ownership restrictions, they’re too strict. This can be implemented by runtime checks where desired. Exception: we must keep them for data objects.
- Add
SOLVEinstruction andREQUIREinstruction (per this topic)- Question: should SOLVE take constraints + preferences directly?
- Preferences must be explicit (cannot be inferred). Preferences could be represented as a function (with our multiformat), which then must have a particular type (or it is just invalid).
- Constraints can potentially be inferred. They kinda have to be inferred anyways, as the resulting value may be used in ways which would result in REVERT in a value-conditional manner.
- Question: should SOLVE take constraints + preferences directly?
- Consider adding
SELFDESTRUCT. This would allow for code objects to be destroyed.DESTROYdoes not work for this as there is no way to enforce permissioning.
- Add
REFLECTinstruction which reads an object’s code (or data-object-ness). Note that the use ofREFLECTwill break observational symmetry (we can no longer replace object-programs by other object-programs which are behaviorally equivalent). - Add
DEFINE_FUNCTIONat an “administrative” level (permissioned) which must include lower-level bytecode legible to the host (e.g. RISC-V).
Transactional semantics:
REVERTis already implicitly transactional, just make it explicit.- Add
BEGIN [controller]which starts a transactional context. This was already somewhat implicit. Transactional contexts must be specific to a controller. - Add
COMMITwhich [attempts to] commit a transactional context. This was already somewhat implicit. Commit returns success/failure (which can subsequently be acted on).TELEPORT(to the appropriate controller) must be called beforeCOMMIT. - Add
TELEPORT [node]which packages the current transactional context as a transaction function + transaction pair and jumps to the specified node to continue execution.TELEPORTcan be used in conjunction withSOLVEfor flexible teleportation (“any solver”). This allows for first-class control over when transaction function “packaging” happens. - Add
LOCAL(or such) which returns the identifier of the executing controller.