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] 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: 2004-09-28 (17:54)
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...


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