FAQ: How can I bootstrap a Squeak image?
Last updated at 9:57 am UTC on 19 June 2014
If I don't have an image and only sources, is it possible to build a new image? Or, with an existing image, can I compile source files and create another brand new image?
Suggestions for further investigation:
- See http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-December/155982.html for a list of images bootstrapped in C/C++ for other Smalltalks and Smalltalk-like languages ( http://www.littlesmalltalk.org/ http://selflanguage.org/ http://slatelanguage.org/ http://smalltalk.gnu.org/ )
- SqueakBootstrapper is an experimental project begun in 2010 (by Yoshiki Ohshima) to build a Squeak-like bytecode image from text files using C and a Parsing Expression Grammar parser generator.
- You might be interested in how another Smalltalk (GNU Smalltalk) does its bootstrapping. The sources for GNU Smalltalk are self contained and its Virtual Machine (Overview) knows how to bootstrap an image from the system classes' source code. You can download it from ftp.gnu.org or one of its mirrors.
- You don't. Some bits in this Squeak are descended from Smalltalk-76. They have been loaded and saved in a 'core image' many times. It is, theoretically possible to start from nothing (since it has been done in the past, back before the earth cooled), but it is not easy.
- In general, the complete source code of a Smalltalk system is not a complete definition of the contents of the image (even for Squeak), though arguably it should be. There are usually a number of pools and dictionaries and such whose contents were defined interactively as needed back in the depths of time. However, these could be hunted down and proper initialization code written for them. Basking in the ignorance of never having actually bootstrapped an image, this is what I would do (I think :-b): first define a special compiler outside of the image you are creating (duh, since you don't have an image to begin with), then give the compiled code (and all related source and information) to a special image creator/interpreter to package everything up, do the initializations, and create all the oops and object structures and such - it would also need to link each CompiledMethod to the sources file and lots of other little details (as Tim said - t'ain't easy). Budd's "Little Smalltalk" has this capability I believe (for a greatly simplified implementation). All this assumes you have a VM that understands your image format and compiled code to run the image on when you get through - if not... The more I think about it the uglier it gets, but you get the idea. – Dwight Hughes
- Use the simulator. http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-December/156170.html