(Issues with) how Slate VM primitives work

Brian Rice water at tunes.org
Sun Mar 12 20:30:30 PST 2006


This is just a general list of recent thoughts.

So, I see some problems with VM primitives as-is:
- `pidginPrimitive does not allow for quick checking of isSmallInt  
based on the definition which means the method body has to do it.  
This could be changed to read/manipulate the dispatch in the  
signature, haven't done it yet. Type-dispatch in the signature is not  
allowed in Slate grammar yet, but would be the more appropriate  
means; either that or I force usage of the method header.
- Errors must be signaled with selectors that the image responds to,  
which means an entry in the linkage table. Generic "primitiveError"s  
are not that much better, but for very simple things it's more  
appropriate to not have the VM try to be smart. In any case, that may  
be the solution.
- Primitives are written as whole methods which:
   - Require a selector to be added to the linkage table as well as  
the method object itself.
   - Make it a little more awkward to re-use primitives or to write  
fall-back Slate code in case the primitive fails or is not available  
in the given VM.
   - Require that the dispatched objects /also/ be in the linkage  
table. To combat growth in the table, extra primitives are often  
attached to the lobby. One possible solution is to just push them all  
into a _primitives namespace as blocks in immutable slots.

I'm not expecting feedback, but if you have ideas or comments, please  
contribute. I'm reading a lot of fundamental Smalltalk books lately  
(e.g. the blue book, Ungar's SOAR book) and these are what are  
informing me.

In any case, changing this level of the VM design would not seem to  
affect further plans to be "VM-less". We shall see.

--
-Brian
http://tunes.org/~water/brice.vcf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/slate/attachments/20060312/0c9f8522/PGP.pgp


More information about the Slate mailing list