Animorphic ST (Strongtalk) released!

Dan Ingalls Dan at SqueakLand.org
Thu Jul 18 17:14:47 UTC 2002


>Sorry for this long response, but I'll try to respond in some detail some of the questions you posed, and offer a few suggestions,
>since I think it would be great if Squeak took off and could take advantage of what we've done.

Hi, David -

Thanks for responding so fully to my musings.  Without spinning off on all branches, I do want to clarify my vision of how the bootstrapping might work...

As you know, the Squeak VM is written in Slang, a subset of Smalltalk that can be translated to C.  Its virtues are...

	It doesn't require learning C if you're a Squeaker
	It can be changed and tested as easily as Smalltalk
	It can be translated to run as fast as C

...and these are its ONLY virtues.  The last item is important for Squeak since the Squeak VM is an interpreter, so running it on itself will only make it slower.

So I am NOT suggesting to write the Snort (Strong Squeak, get it ;-) compiler in Slang.  It is a compiler, so running it on itself WILL make it faster.  The idea is to write it all in Snort (not Slang), except for the runtime required by the compiler (hopefully much of that could still be written in Slang).  [I've talked with Ian about applying the same approach to Jitter].

So, what happens when you start it?

	It starts to run the first method which is not translated
		so it runs the interpreter
	Things lumber along for a while this way until something
		notices the umpteenth execution of the same method
		and asks for it to be compiled
	Now the compiler starts to run but, of course, it's not
		translated so it starts kind of slow
	Along the way the compiler hits some inner loops and these
		need in turn to be translated
	Gradually the compiler speeds up until it runs as fast
		as StrongTalk, and what more could we ask for?

This is, of course recursive but, as long as the system supports both interpreted and translated code, I don't think it's a problem as long as you recognize three states of a method:

	Interpreted
	Being translated
	Translated

The first and last are obvious.  You need the middle one so as not to launch circular requests to translate a method that is already being translated.  Recursion is OK, but endless looping is not.

There are, of course variants of this approach that are less recursive (like, run it all interpreted, compile the compiler, and then turn on the compiled compiler) but, hey, recursive application is our thing.

My point is that I'm not recommending do write it in Slang like Squeak (an interpreter that you can translate), but to write it in Snort, a compiler that can compile itself.  It's still the Squeak philosophy:  write everything in the home language, and do what it takes to make it run.

	- Dan



More information about the Squeak-dev mailing list