[Vm-dev] primitive external call

tim Rowledge tim at rowledge.org
Sat May 31 17:23:17 UTC 2014


To expand a little - 

On 31-05-2014, at 8:03 AM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> 
> So when the VM executes primitive 117 it looks up that literal, loads the module, and executes the named primitive.

And before anyone starts complaining about how slow that is and why would we do that - the address is cached exactly as all the other primitive code addresses are. It’s possible there is an OS that requires some time-sucking intermediary but none of the ones Andreas & I originally developed the named prim stuff for had any problem.


> These modules can be linked into the VM executable itself ("built-in modules") or distributed as separate files ("external modules"). In the latter case they are dynamic libraries (DLLs on Windows, *.so files on Linux etc.)

As an extreme example, RISC OS is built with all the plugins external and dynamically loaded. You can go from that extreme to the other - all built internal - and the end user will not notice any difference. One very useful trick that is (unless removed ?) there is that an external plugin trumps internal - so a buggy internally bound plugin is superseded by a suitable external one.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Military Intelligence




More information about the Vm-dev mailing list