Multiple OS Windows for Squeak? & Squeak 4.0 VM Redesign using OOC style?

David T. Lewis lewis at mail.msen.com
Sat Apr 17 18:38:11 UTC 2004


On Sat, Apr 17, 2004 at 10:42:33AM -0700, Peter William Lount wrote:
> 
> I've not looked at the Display smalltalk code or the VM C generated and hand
> written code yet, but it occurs to me that an object oriented approach at
> the C level like what the "Io Language", http://www.IoLanguage.com, uses
> would be really nice for the squeak vm. The approach to writing C level code
> that Steve Dekorte has taken is influenced by Objective-C, which in turn is
> influence by Smalltalk. It is a unique (and thus new as far as I've seen for
> writing C style) and elegant means of naming C structure and functions as if
> they were classes and methods in Objective-C. His page
> http://iolanguage.com/Software/C/Notes/OOC.html describes his approach.
> 
> How does this relate to the multiple os windows and other parts of the
> squeak vm, like multiple drivers for sound cards, multiple copies of the
> squeak vm, squeak vm embedded in another application such as apache, etc...?

Peter, I think you will be pleasantly surprised to find how much of the "low
level" bits of Squeak are already done this way. You have probably already
read the Back to the Future paper; if not, by all means have a look at
http://minnow.cc.gatech.edu/squeak/3397. The object memory and interpreter
are written entirely in Smalltalk already, as are many of the plugin methods.

Very little of the low level code needs to be written in C. For example, the
OSProcess plugin is written entirely in Smalltalk, and only requires some
small snippets of embedded C (the "self cCode:" calls) to get at complex
data structures or function calls with tricky parameter lists (admittedly,
there is some rather ugly procedural Smalltalk in there, but still... ;)

External things like files and sockets are simple data structures on
the C side, with "handles" maintained in the image (evaluate "Smalltalk
externalObjects").  If you wanted to keep track of multiple external displays,
you would just follow the same pattern.

You can see some examples of this approach for controlling the X window
Squeak display in XDisplayControlPlugin. There is of course only one external
X window display in the current implementation, but you can see how this
could be extended to work with more than one display by keeping track of
external displays in the external objects registry.

> A very cool feature of the Io Langauge vm is that it can be embedded within
> other C programs and it can also have multiple vm's instantiated at the same
> time in the same process space! Very nice features. Imagine squeak running
> inside of Apache as Perl does! To support this a restructing of the vm
> generated and handwrtiten code is needed such that they all refer to their
> vm via a pointer since there are multiple vm's possible.

That would be a neat trick.

> A really nice capability that this offers is more bullet proof debugging.
> Imagine one squeak vm instance in a process debugging the other vm instance
> in the image. What happens to images in this case? Each loads it's own
> image! But they have more intimate access possibilities than seperate
> processes. In some ways this is similar to the unix squeak vm that can
> "fork" off child processes and control them from the parent image.

I suspect that Craig Latta may have something to say about this. I think he
has implemented some remote debugging already.

Dave




More information about the Squeak-dev mailing list