[VM] Plugins and namespaces

Tim Rowledge tim at sumeru.stanford.edu
Fri Mar 1 21:46:35 UTC 2002


Sigh; I thought I'd replied to this. Sorry for the delay. <HHGTTG>One
day civilization will arise again and there will be more lemon scented
paper napkins.</HHGTTG>



 "PhiHo Hoang"
<phiho.hoang at rogers.com> is claimed by the authorities to have written:

> 	Why do you need two places for plugins, src/vm/intplugins and
> src/plugins ? Is there any problem if all plugins have a home under
> src/plugins ?
There are two places because there are two kinds of plugins. Those in
src/vm/intplugin will be glommed in with themain vm to become internal
and those in src/plugins will be elevated to the glorious heights of
external plugins, there to lead an indepentent life of stardom and moral
turpitude.
Having the two places has the virtue of implicitly encoding what the
code is to be treated as. Yes, one could indeed encode it other ways,
for example it is undoubtedly possible that VMMaker could generate a
file listing which plugins are internal and which external, with some
extra work to read the appropriate directory contents etc. But it's so
easy to see the implied meaning from the directory tree, so why hide it?


> 	Do you have any plan to support slide-able plugins, all exported
> names are always fully qualified with the name of the plugin and a
> little change in the lookup mechanism, dropping 'sqNamedPrimitives.h' ?
> Of course this only work on platforms with support for shared modules.
This is exactly the problem that makes this impossible. Portability is
important and we use our own mechanism for handling lookup with internal
plugins precisely becasue some platforms can't do it otherwise. It's
probably faster than most OS versions anyway because it is so specific
to our needs rather than general.
Certainly we could make the function names in external plugins use the
same naming as those in internal plugins but I'm not sure there is any
actual value in it. I suppose there isn't much cost either, though it
would mean concatentating two strings every time we do a lookup.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: RCS: Read Card Sideways




More information about the Squeak-dev mailing list