Virtual Machine hacking
Last updated at 4:29 am UTC on 1 October 2010
Among those things that make Squeak unique in the Smalltalk world: the ability to change everything about the system, including the Virtual Machine/VM.
The VM is build from two components
- Code written in Smalltalk and usable as a simulation of the workings of the VM which is converted to C code output by the VMMaker.
- Code written by hand in C which provides platform specific support
As of January 2005, the Squeak VM platform specific code is no longer being maintained at SourceForge. We concluded that their attitude to the Squeak License was just too annoying.
The new Subversion based repository is at http://squeakvm.org/svn/squeak/trunk. There is a mirror at http://box1.squeakfoundation.org/svn/mirrors/squeak.
To get the latest platform sources for the interpreter (see below for Cog), execute
svn co http://squeakvm.org/svn/squeak/trunk
This should produce a directory named 'platforms' with a number of subdirectories which at least need to include 'Cross' and one named for your target OS/machine. Currently we support
- Unix of various flavours
- RISC OS
WARNING the latest sources retrieved in this manner will not always compile without problems. It is impossible to guarantee that every port maintainer will be able to make their platform specific tree stay exactly up to date at all times. When a new version of VMMaker is published it may take some time for people to catch up. We try to avoid this issue but it is inevitable on occasion. When stable seeming stages are achieved we will endeavour to make a branch for the VMMaker version so that it is easier to fetch matching sets of files. See Squeak VM port maintainers to find out who to contact to report problems
The Cog VM source is organized slightly differently. The entire tree, including generated sources, platform directories, build directories for Mac OS X, win32 and linux and an image containing a complete VMMaker set-up for generating sources is available via
svn co http://squeakvm.org/svn/squeak/branches/Cog
Here are some Unsupported method 'M-POST' for accessing SVN in case you experience troubles.
Until we can write a suitable Subversion guide you can still read the now obsolete Virtual Machine Hacking (2003 and 2018 links).
See also: Maximum Squeak
For those of you interested in making Squeak run on a system we haven't yet covered, here is the beginnings of a guide to porting on Porting Squeak
Other enhancements and extensions
- Named Primitives can be added easily using the CCodeGenerator. You can write some sorts (see Klett or StarSqueak for examples) in Smalltalk, test them, add a few type hints, and translate them to C for speed. Others sorts of primitive (see FilePlugin, SocketPlugin etc) need the additions of C code, perhaps in outside libraries. Look at subclasses of InterpreterPlugin - found in the VMMaker package - for more details. See VMMaker also for explanations of how to generate and build the plugins.
If you are looking for the old history see:Virtual Machine Hacking (2003 and 2018 links)