Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Observations on OCaml vs. Haskell
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] Caml monomorphisation (was Observations on OCaml vs. Haskell)
On Tuesday 28 September 2004 11:10, Diego Olivier Fernandez Pons wrote:
> Why doesn't Caml compiler specialize the type of [max]?

OCaml tends to side with concise code. So it doesn't like inlining and type 
specializing, preferring heavy factoring and run-time dispatch instead.

Analysing the productivity of these trade-offs is notoriously tricky because 
there are lots of interdependent variables. So the heuristics for inlining 
and type specialization are suspiciously subjective. Hence, the current 
approach is just being cautious.

I've considered writing a whole program optimiser to do things like type 
specialization and inlining but in most cases it wouldn't buy you much. It 
some it could buy you a few times better performance though...

Cheers,
Jon.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners