[Cuis-dev] Primitives

Vanessa Freudenberg vanessa at codefrau.net
Sat Jun 15 11:06:17 PDT 2024


On Sat, Jun 15, 2024 at 07:02 Mark Volkmann via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

>
> Thanks Ken! Where can I find a list of all the primitives supported by
> Cuis Smalltalk? In particular, I want to learn what 233 does which is used
> in the instance method fullScreenMode: of the DisplayScreen class.
>

It’s not so much what primitives Cuis supports, but rather what the VM it
is running on provides. Some VMs implement optional primitives for speed
up, others don’t. Some primitives are identical across platforms, others
are not.

To learn what exactly primitive 233 does, you have various ways. The
primary way is by looking at a VMMaker image:

https://source.squeak.org/VMMaker.html
<http://source.squeak.org/VMMaker.html>

This is the repo that has all the Smalltalk source code (the VM is mostly
written in a subset of Smalltalk called Slang, transpiled to C, then
compiled and linked with platform-specific code to create the VM
executable).

If you click the “Latest” tab and then sort by timestamp you can see which
packages are under active development.

The default Cuis VM is in the “oscog” branch of the VMMaker package.

There is a method Interpreter class>>initializePrimitiveTable
where you find what method index 233 maps to.

Following this stuff is interesting but not trivial, especially since it
calls out to platform-specific code which is in a different repository:

https://github.com/OpenSmalltalk/opensmalltalk-vm

Following the instructions in there to build your own VMMaker image gets
you a thing to fully explore VM stuff.

The code and behavior can be very different across platforms. John McIntosh
wrote some amazing, if incomplete documentation, see
<https://isqueak.org/ioSetDisplayMode>
https://isqueak.org/PlatformVMAPI

There are other virtual machines that are a lot simpler to understand. Not
to toot my own horn too much, but in SqueakJS it’s pretty trivial to find
out what exactly primitive 233 does:

https://github.com/search?q=repo%3Acodefrau%2FSqueakJS%20233&type=code

… but again, this is necessarily different from the native Mac or Win or
X11 implementations.

HTH,
Nessa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240615/d1e0830a/attachment-0001.htm>


More information about the Cuis-dev mailing list