English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: Why OCaml sucks
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-05-12 (19:39)
From: Karl Zilles <zilles@1...>
Subject: Re: [Caml-list] Re: Why OCaml sucks
Arthur Chan wrote:
>     Yet, if you look at things in the light of "optimization is
>     depessimization",
>     you'd much rather have easier to read code, than code which is ugly
>     because
>     you preoptimized it by hand. This is why, for me, Ocaml has a long
>     way to go
>     to make it useful for run-of-the-mill production code. My pet peev is
>     performance penalty paid for writing in functional style where it
>     actually
>     makes sense -- say passing an arithmetic operator to a map-style
>     function.
> What do you mean by this?  What language would not incur this kind of 
> performance hit?  Is F# able to optimize this out or were you referring 
> to something else?

For Ocaml: "when inlining higher-order functions with known function 
arguments,  those known function arguments are not themselves inlined."


(This is an old post, if things have changed I would love to be corrected.)

sml can inline such functions, making passing + to a map style function 
potentially as efficient as writing a procedural loop.