Well, offering a numerical performance at the same level as C/C++ with Gambit-C is certainly an amazing feat, and it deserves more publicity and exposure. And maybe a more extensive paper.

There is obviously this performance myth, but that was not exactly what I meant when I answered the question in the meeting. I realize that my answer might have been misleading. So maybe I should try to give a clearer answer:

1. The scheme system I'm using does not have a great numerical performance, and in this case it is common knowledge, it's admitted and documented. Instead, this implementation offers bindings to external mathematical libraries, which in my view is not necessarily a bad method.

2. We chose scheme for other reasons that where more critical for our task when we made this decision. We already had the C++ libraries for the numerical aspects. We needed other qualities that I think are specific to scheme or functional and logical languages. In the talk, I tried to define these specific qualities. Being able to compete with C++ in it's own turf would certainly be a plus. But in the context of the problem we had to solve, and with the time we had to do it, it was not a requirement.

3. I think the ability to easily incorporate C/C++ code and libraries is in itself a crucial asset, and it is worth emphasising. Many scheme systems are exceptionally good at it (and Gambit-C and chicken both are). That was one of the factor for our choice of scheme.

4. This is a matter of personal taste, but for me, as much as I hate using C or C++ for working on trees and formal structures and other complex structures, I don't dislike them for linear iterative programming. (Maybe because I did my first real programming in Fortran). In short, I don't necessarily see an all-or-thing war between C++ and scheme, quite on the opposite.

All this said, I will certainly try Gambit-C for numerical calculations as soon as I can :)

Cheers

Houman


On 6-Dec-07, at 4:29 PM, Marc Feeley wrote:

Yesterday at the MSLUG meeting Houman Zolfaghari gave an interesting  

talk on the use of Scheme in the "real-world".  In his presentation he  

said that in his work he uses both C++ and Scheme; the parts that do  

floating-point intensive computations are programmed in C++ and the  

scripts are written in Scheme.  An audience member asked why Scheme  

was not being used for the numerical computations.  Houman stated, as  

if it was common knowledge, that C++ had better performance than  

Scheme on numerical computations.  I have heard this misconception  

from several people, and I am compelled to set the record straight, at  

least to the MSLUG members who should know better.


Brad Lucier has been using Gambit-C for floating-point intensive  

computations for a long time.  His involvement with Gambit-C has  

helped me improve the compiler's performance on numerical  

computation.  For the kind of computations that he does (partial  

differential equations) the performance of Gambit-C is equal to that  

of C.  The short paper he wrote on the subject, presented at the 2000  

Scheme workshop, is:


   http://www.ccs.neu.edu/home/matthias/Scheme2000/lucier.ps