Squeak
  links to this page:    
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Named Primitives
Last updated at 1:27 pm UTC on 23 January 2006
Named Primitives a.k.a. Pluggable Primitives a.k.a. Plugins

from Andrew Greenberg's named primitive tutorial:
"Squeak Central has provided a new primitive interface for extending the VM without having to modify it. A pluggable primitive is called by name, not by number, and its code can reside in an external library (DSO on Unix, DLL on Windows, Shared Libraries on MacOS) or in the VM library itself. An example is FFT>>pluginTest which is a factor 60-100 times faster than the regular (interpreted) FFT."

(note: this page has a lot of overlap with Maximum Squeak. Perhaps someone with a bit more gumption could unify them)

Resources






Andrew Greenberg's notes were helpful for getting started in using the new named primitive facilities.

As an addendum for those on Linux or another Unixy platform, the commands I used to generate the shared library module for Foo.c were as follows on RedHat Linux 5.2:
$ cd /usr/local/squeak
$ ls 
Foo.c
Squeak2.3.changes
Squeak2.3.image
SqueakV2.sources
SqueakVM-2.3-i386-linux2.0.36
$
# this line must reference your squeak source
$ cc -c -I/usr/local/src/squeak-2.3/src Foo.c
$ ld -shared -o Foo.so Foo.o
# I used ld -G -o Foo.so Foo.o on Solaris - *405*
$ ls
Foo.c
Foo.o
Foo.so
Squeak2.3.changes
Squeak2.3.image
SqueakV2.sources
SqueakVM-2.3-i386-linux2.0.36

Thanks to the Squeak Team for this new facility and to Andrew for the notes! I think the notes should be added to the Squeak Swiki for future reference.

WellThot Inc.