Status Report on Squeak Environments (name spaces)

Dan Ingalls Dan.Ingalls at disney.com
Sun Dec 5 08:49:34 UTC 1999


Folks -

Right now I'm in the throes of preparing to move to a different house (it happens Wed).  However, in between packing boxes, etc, I've managed to make it over a significant hump in the Squeak Environments project.  I thought you might be interested.  Here's a summary of some early work...

[X]	Add 'environment' and 'category' to all classes
[X]	Make cachedClassNames be an instVar of SystemDictionary.
[X]	Define a new class Environment
[X]	Define Smalltalk as an instance of a subclass of Environment
		with all associations carefully transferred.
[X]	Define doesNotUnderstand: for Environments so they can find things
	before they have been defined as exports (via messages).
[X]	Factor all the SystemOrganization so it can easily be grouped...

	Kernel (incl numbers)
	Collections
	Graphics
	Tools (used to be called interface)
	System (incl files)
	--------------
	ST80 (old MVC stuff)
	Morphic
	Sound
	Network
	Postscript
	Squeak (VM support stuff)
	Balloon (incl Flash and TT)
	Baloon3D (incl Alice, Wonderland and VRML)
	
Above the line are only distinctions in the system organization -- all those classes are still in the environment called Smalltalk.  Below the line, each category is its own environment (dictionary like Smalltalk). I've had a lot of fun partitioning these to minimize remote references, and trying to anticipate economic use of memory by segment swapping when various parts of the system are not in use (you knew environments are supposed to be swappable, right?).  I strongly want to get Tools out of the kernel too, since lots of the development system does not get used when normal applications are running.

Here's the hump I just got over.  One doit does the following...
[X]	Runs through SystemOrganizationn making up Environments for
		each of the non-kernel major categories.
[X]	Moves each class (association) into the new envt
		Sets new envt and category for that class
[X]	Automatically determines methods that are referring to globals out
		of their local access scope (there are 344 of them).
		[out of (gasp) 24,000, this is pretty good I think]
[X]	Applies a special lenient parser to parse them, determining
		source code positions of every such reference, and then
		rewrites them in the form of a proper remote global reference.
[X]	After this I recompiled the whole system without error.
	
What remains (between now and the move) is 
[ ]	Run through projects adding default environments
		Move proj-associated globals (Players, eg) to that environment
		This should help project swapping by keeping things more local.
[ ]	Relocate Pool Dictionaries to appropriate environments.
[ ]	Get rid of PoolDictionaries as a special feature of class defs.
[ ]	Hook Image Segments up and see how much we can throw out
		(and if it will come back again ;-)
[ ]	I'd like to hook this up to STP's package browser.
[ ]	Associate a source code file with every environment that can
		be used for package export.

So far it's still a pretty small fileIn (29K), after which you can elect to execute 'Smalltalk reorganizeEverything' (this admittedly rewrites 300K of source code).

Just thought you might be interested in the progress.  I'm planning to put this all out in a preliminary state, along with a few more updates in a couple of days so people can play around with it, find problems, and make suggestions.  Then when I'm settled down again, I should be able to bring it to a reasonable state of completion for 2.7 final (in which it will still be an elective feature).

	- Dan





More information about the Squeak-dev mailing list