Porting Squeak

Les Tyrrell tyrrell at iserve11.lis.uiuc.edu
Sun Jan 13 06:54:49 UTC 2002


----- Original Message ----- 
From: John Hinsley <jhinsley at telinco.co.uk>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Saturday, January 12, 2002 5:50 PM
Subject: Re: Porting Squeak

> Just a thought:
> 
> another approach (altogether!) would be to use Squeak to output files in
> another language. For example, Small Eiffel (and, no doubt, other
> Eiffels) can output C code (to be compiled with gcc) and Java byte code. 

<disclaimer: going totally from dim recollections here>
Broadly speaking, such approaches have not been widely used, though there are several that do exist for Smalltalk.  For instance, Producer was written to create Objective-C programs from Smalltalk-80 source files long ago, and an updated version can now be found with POC.  Smalltalk/X has the Smalltalk to C translator which I believe is called StIC.  Squeak has Slang, which may be less ambitious but is perhaps the most widely used of these three.  I've never used any of these, though I've had some revived interest in these things lately.  The general idea was that the target language was neccessary as there was a perception that Smalltalk was "too slow".  Producer assumed that everything in Smalltalk was too slow- this was never the case, and thus Producer was largely never used.  Slang and StIC assumed that only certain things were too slow, and both have been used much more than Producer.

Generally, the pattern that seems to work best for Smalltalk is to do nearly everything in the image, and in rare cases ( though significant from a CPU useage view ) delegate cpu-intensive tasks to specialized primitives.  BitBlt is a good example of this approach.  Translating the entirety of a Smalltalk system into another language has not yielded overwhelmingly good results in the past ( just thought of another example- Xanadu 92 was written in ObjectWorks... except that there, the Xanadu team didn't like the licensing that came with ObjectWorks... so they modified ObjectWorks to support translation of their code to another language, called X++ ( a modified version of C++, why I don't know ).  So, the Xanadu 92 source code is actually just something to support coding in X++.  I think they would have been better off just sticking to straight St-80, but then that is hindsight-enabled armchair quarterbacking speaking.

> Of course, there are disadvantages, as well as advantages, to doing
> stuff this way ;-).

Disadvantages, certainly- there are many fewer advantages, though. So, it is best to do this stuff judiciously, or so it would seem.

> Cheers
> 
> John






More information about the Squeak-dev mailing list