[squeak-dev] primitives

Yoshiki Ohshima yoshiki at vpri.org
Sat Nov 1 15:41:16 UTC 2008


At Sat, 1 Nov 2008 10:17:38 -0500,
Mark Volkmann wrote:
> 
> Where can I read about the standard primitives in Squeak? I can find  
> lots of resources on writing my own primitives, but I want to know  
> what the existing ones do. For example, I'm looking at the "new"  
> method in Behavior and I see "<primitive: 70>". Where can I find a  
> description of that does?

  For "new", you would probably like to know the object and object
memory format as well.  So, reading the related sections in:

http://www.google.com/search?q=squeak+back+to+the+future

would help.  Then, the source is the best "resource".  Install the
VMMaker and look at the Interpreter class>>initializePrimitiveTable.
It says primitive 70 is primitiveNew.  So browse the implementor(s) of
primitiveNew and you see what it does.

Or, you can view the versions up to when the Interpreter was still
maintained in the image at:

http://tinlizzie.org:8080/seaside/examples/authorship2

check off the "show only existing" box, and navigate to Interpreter
and navigate to primitiveNew.  You see the code with diffs.

> Is there an easy way to find the  
> corresponding C source code?

  The best thing is to generate the C code by yourself from VMMaker,
but just to get the feel of it, go to:

http://squeakvm.org/cgi-bin/viewcvs.cgi/trunk/platforms/unix/src/vm/interp.c?rev=1870&view=auto

and search for primitiveNew.

It is also a good idea to download an old image where the
InterpreterSimulator still works. Squeak 2.4c would be good, if I
remember correctly.

-- Yoshiki



More information about the Squeak-dev mailing list