Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Why are arithmetic functions not polymorph?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: easy print and read (was: [Caml-list] Why are arithmetic functions not polymorph?)

At 12:46 PM 6/6/2003 +0200, Pierre Weis wrote:
>All this hard work needed a long time to mature (1995 -> 2003!) and is
>now in a stable and satisfying state.

This is great.  My concern about generics in ocaml is one of efficiency.  I 
read the paper (as much as I could understand), and the flow array stuff 
seems smart and better than type pattern matching in the case where you 
don't know the definition of the generic function at the call point, but is 
there going to be inlining with generics as well in this initial 
implementation?  In other words, if I want to define (+) for ints and 
floats, and I statically know the type at the point of call, will the 
compiler inline the add_int or add_float appropriately and do no runtime 
checks (or flow array traversals)?  For generics to be really useful for 
fine grained math operations (one of the better applications of overloading 
(especially in ocaml since the op. thing is so ugly), in my opinion) I 
think this is going to be necessary.

Chris


-------------------
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