Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Some clarifications to the language shootout page
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] Some clarifications to the language shootout page
Hi list,

Here is the conclusion of our mail exchange with Manuel:

> ====
> Just one more thing, I have changed the Scheme code a very little bit to
> make it more similar to the Caml code. That is, I have changed the 
> construction of the row vectors. The original initialization 
>   (mx (make-vector rows 0.0))
> was breaking the CFA because mx what not 
> correctly typed vector of vector of double. I have replaced it with:
>   (mx (make-vector rows (make-vector 0 0.0)))
> Then, you should compile with:
>   bigloo -v2 -Obench foo.scm  -copt "-O3 -fomit-frame-pointer"
> On my machine with this two modifications I see an improvement of about 17%.
> It is still insufficient to defeat Ocaml but we are getting a little closer  [:-)] 
> -- 
> Manuel

Hi Manuel,

As you should have noticed, I did not try to optimize anything in the
Caml code: I just tried a litteral translation from Scheme to Caml. In
effect, the original Caml code was not optimally clear (difficult to
read and difficult to compile) and was compared to a (relatively)
clear Scheme code. Mere translation of the Scheme code to Caml just
improves the runtime by a factor of 2 or so. As you surely know
already, I was obliged to change the initialization, since

   (mx (make-vector rows 0.0))

is ill-typed in Caml.

This is amazing that now this well-typed Caml version, once translated
back to Scheme, improves the original Scheme version!

I think that this proves, once more, that our languages are not as
different as people think they are :)


Pierre Weis

INRIA, Projet Cristal,,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: