Contrasting Object References with Capabilities

It is instructive to examine the similarities of capabilities and object references, or even pointers to structures. We start with pointers to structures.

Bliss, Pascal and C are languages that early on supported a style of programing in a higher level language that had been known for a while as programming with control blocks. A control block is very nearly a structure. A block of core would be allocated and thereby a pointer to that block created. The pointer would be passed around to those routines needing access to the block. The pointer would also be stored in other control blocks. None of these languages gave much assurance that a block would not be referenced by other than a pointer acquired in due course of the computation but most correct program held to such discipline. There was little discipline in reclaiming the storage of the block and this was and is error prone. Accessing dead blocks by stale pointers is a common bug.

With object technology only code compiled in the scope of data declarations can access the data. Further that scope can be arranged so that I may be able to point to the object (actually control block) without accessing the fields therein. In effect, zot* is in scope but not zot.

In a typical application designed and implemented for Keykos the various code modules are connected much as objects are in OO languages with a few differences. The Keykos object is typically larger than a Java or C++ class.

Prior to the control block style, the elements necessary to describe some entity would be stored at the same index in different arrays. Early versions of the PDP-10 operating system identified a job (process) with an index. The index would apply equally to many different arrays. The size of such arrays was fixed at least as early as load time. The Fortran language supported this style of code and did not support control blocks. Control blocks are more convenient for the cache and also do not require large addresses to be included in the instruction stream.