[plt-scheme] xxx chooses MzScheme as preferred language

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed May 31 18:30:48 EDT 2006

On May 31, 2006, at 5:53 PM, Jim Blandy wrote:

> On 5/31/06, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
>> Bigloo isn't Scheme per se. To achieve such numbers, you're 
>> programming
>> in a special-purpose language, especially when it comes to floats. You
>> write (fp+ ...) everywhere. In Bigloo you declare types at module
>> boundaries.
>> Chez achieved this kind of efficiency in 1993 (without all these
>> hacks). Bruce Duba and I showed our systems hacks at Rice that their
>> claims were wrong. But boy we had to bend over backwards to get Chez
>> -o3 to be within 10% of then-C compilers. And the very moment we went
>> from ints to floats, we were hosed again (and didn't pursue it).
> I'm very interested in these questions, so let me pick at this a bit
> to get more detail.
> When you say you acheived Bigloo-like efficiency "without all these
> hacks", I assume you're referring to the deviations from Scheme you
> mentioned in the previous paragraph: special-purpose floating-point
> operators, and types declared at module boundaries.


> But you say that
> you were hosed if you used floats --- so you trivially avoided needing
> special-purpose floating-point operators, by not using any
> floating-point values?  Then it wasn't the same problem, was it?

No, yes. The C problems all involve vector stuff and usually some 
amount of random access. So lists don't hack it. So you immediately use 
data structure and occasionally algorithmic tricks. Eventually you 
"hand prove" type violations away and run it with -O3. (You also try to 
get around vector-bound checks.)

As long as your vectors use ints, you did as well as these alternative 
Scheme implementations. Indeed, you could get within a 10 perhaps 20% 
of C. (I wouldn't call it "the natural Scheme program anymore" because 
of the algorithmics.)

When the vectors contain floats, you lose a factor of 3 or so in Chez. 
You lose more in Bigloo or Gambit unless you go outside of plain Scheme 
already. But when these latter (and now Chez) rewrite their programs to 
separate out numeric types, they beat Chez. So that's the gain over 10 
years or so.

Is this clearer? 

Posted on the users mailing list.