jhinsley at telinco.co.uk
Sun Jan 13 13:19:56 UTC 2002
Les Tyrrell wrote:
> ----- 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.
There are some really nice examples in there: thanks! I've never been
convinced by the speed argument, especially as far as Java is concerned:
just compare Borland's Java IDE (allegedly written in Java) with Squeak
or with the IBM Java IDE (allegedly written partly in Smalltalk). From
time to time I have a running argument with one of the MySQL developers
who claims to have benchmarked a Smalltalk written project against a C++
version with the C++ one benchmarking at 6x the speed, but as I've no
access to either project, it's impossible to see why. One day, maybe,
I'll have to re-write MySQL in Squeak :-( And even he maintains that
Smalltalk is more fun.
> > 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.
Agreed. The only real advantages I can see is that a project produced in
Smalltalk could easily be ported and further developed in the ported
language -- the disadvantage here being that it would be difficult to
re-unite the projects (almost a case of auto-forking), plus the old ones
about the relative obscurity of compiled code and the possibility of
producing a small executable (rather than a big "distributable").
Reputed to be the reason Windows 2000 was nearly a year late, (paid in
shares M$Ds needed the cash and kudos) Netproject's Eddie Bleasdale has
renewed his challenge to virus writers. The first person to infect his
Linux box wins 10,000 pounds.
More information about the Squeak-dev