Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
Interface is the interface via which an addon is loaded into a VM.
Addons in iolang are separate packages, which may be linked dynamically (on platforms supporting -buildmode=plugin) or statically. The addon is loaded by calling its IoAddon function, which must be of type func() Interface. This function will be called no more than once per interpreter. The plugin itself is opened only once per program, so its init functions may run less than once per time it is added to an interpreter.
For dynamically loaded addons, the Io program's Importer uses a CFunction to lookup the IoAddon function in the plugin when needed. For statically linked addons, however, the program which creates the VM must manually load all addons using the VM's LoadAddon method.