[modules] {Image Shrink and Initialization}

Marcio Marchini mqm at magma.ca
Tue Aug 21 19:11:41 UTC 2001


> 2) Initialization order needs to be well defined and repeatable.  Team/V
> and ANSI Smalltalk both claim this but only if a programmer completely
> specifies the initialization order in some inconvenient way.  This is one
> area where I think Java has done a better job.  The Java rule could be
> loosely stated this way: a class is automatically initialized the first
> time an executing method references the class by name.  I think
> the Squeak
> vm (or alternatively compiler) could be pretty easily adapted to support
> this semantics.  If anyone wants to try let me know and I'll try
> to provide
> a more complete "specification".


	A bit of warning: the Java initialization is not that simple, because you
need to detect cycles and also work despite concurrency. The Java spec has
the steps necessary, and having implemented it myself I can say it is not
that trivial, but once implemented you don't need to get back to it. But
some people still don't quite understand how the initialization works,
getting lost in the different initialization exceptions that can be
triggered.

marcio





More information about the Squeak-dev mailing list