Stubs: A dynamic linking mechanism for Tcl, Tk and extensions. http://www.purl.org/tcl/home/doc/howto/stubs.html
What does it do ?
it is possible to use them with any library which is compatible. e.g. an extension which was originally built for Tcl 8.0 should work with Tcl 8.1, and an extension built for Tcl 8.1 could work with Tcl 8.0.
How does it do it ?
Basically the stub mechanism provides a cross platform dynamic linking mechanism using tables of function pointers.
To see the differences take a look at the following which describes what happens when Tcl loads two different extensions.
1) Tcl asks the operating system to load the extension. 2) The operating system loads the extension and then tries to resolve any undefined symbols. This process is very operating system dependent but involves one or more of the following steps. 1) Resolve any symbols which are defined in the current process context. (Backlinking). 2) Find and load any libraries that the extension is dependent on. This involves searching paths defined through a variety of operating system dependent methods. 3) Resolve any symbols which are defined in the new libraries. 3) Tcl then calls the extension's initialisation entry point.
1) Tcl asks the operating system to load the extension. 2) The operating system does so, resolving any non Tcl symbols. 3) Tcl calls the extension's initialisation entry point. 4) The extension obtains the pointer(s) to Tcl's stub table(s) and uses that to call Tcl.
--- Links