[Vm-dev] Question about primitives

Eliot Miranda eliot.miranda at gmail.com
Mon Feb 8 18:41:05 UTC 2010


On Mon, Feb 8, 2010 at 9:42 AM, Mariano Martinez Peck <marianopeck at gmail.com
> wrote:

>
> Hi folks. Disusing with a friend, he asked me if Squeak was completely
> written in itself (actually, SLANG). I think (I am not sure) that some parts
> of the VM as Interpreter, ObjectMemory, and most primitives are written in
> SLANG and then using VMMaker I can convert from that to C. Ok.....but...I
> think I heard that there are primitives that are directly written in C (not
> SLANG, no translation).  Is this true ?
>

If you look at the blue book and its definition of what Smalltalk-80 is then
all of that except lower-level window management (creating the window in
which Squeak appears, collecting events from the GUI), and image I/O
(reading and writing the image to and from the snapshot file) is entirely
written in Slang and can be run as a simulation.  But go beyond that to the
large array of primitives for sound, video and so on and lots of the Slang
code for the primitives is merely a wrapper around some library that
actually implements the functionality.


> If true, how can be that addressed ? where is the C code of that? because,
> I take VMMaker, I convert to C, then compile, install and I have a working
> VM. So...that C code must come somewhere...where is it ? how can I know if a
> primitive is written in SLANG or directly in C?
>

As far as I'm aware all primitives are written in Slang, even if they're
simply wrappers.  But if you look in the files in
    platforms/{Cross,Mac OS,unix}/plugins/FooPlugin
you'll find cross-platform and platform-specific support code for each
plugin (a plugin being a related suite of primitives), and look in the src
tree for plugins and extplugins and look in their subdirectries you'll find
all the generated Slang plugin code.

A better place to look is in VMMaker using the browser.  There you'll see
different kinds of primitive from things like GeniePlugin where all the code
is written in Slang to SocketPlugin where all the code is merely wrappers
around platform-specific support code.

HTH
Eliot


> I hope someone can help this newbie :)
>
> Thanks in advance,
>
> Mariano
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100208/702ba51e/attachment.htm


More information about the Vm-dev mailing list