From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 57786BB84 for ; Sun, 22 Jun 2008 01:38:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4CAFQtXUjCpx6wiGdsb2JhbACSaQEBAQ8gmn8 X-IronPort-AV: E=Sophos;i="4.27,684,1204498800"; d="scan'208";a="12395243" Received: from smtpmin.univ-orleans.fr (HELO min.univ-orleans.fr) ([194.167.30.176]) by mail2-smtp-roc.national.inria.fr with ESMTP; 22 Jun 2008 01:38:25 +0200 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by min.univ-orleans.fr (Postfix) with ESMTP id 664AC12B42C; Sun, 22 Jun 2008 01:38:25 +0200 (CEST) Received: from [192.168.0.12] (ras75-4-82-235-58-110.fbx.proxad.net [82.235.58.110]) by smtps.univ-orleans.fr (Postfix) with ESMTP id E7D7F36E60; Sun, 22 Jun 2008 01:38:29 +0200 (CEST) Subject: Re: [Caml-list] cost of monads From: David Teller To: Warren Harris Cc: caml-list@yquem.inria.fr In-Reply-To: <3822B729-FD99-429E-8150-CEAA57E4D84F@gmail.com> References: <3822B729-FD99-429E-8150-CEAA57E4D84F@gmail.com> Content-Type: text/plain Date: Sun, 22 Jun 2008 01:41:44 +0200 Message-Id: <1214091704.6190.16.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; monads:01 univ-orleans:01 monads:01 ocaml:01 cheers:01 ocaml:01 abstraction:01 transformers:01 avoided:01 haskell:01 univ-orleans:01 lifo:01 warren:98 warren:98 liquidations:98 If you're interested, I'm currently putting the last touch on a paper dealing with monads in OCaml -- including some benchmarks. I'll share the data once I'm done with the writing. Cheers, David On Sat, 2008-06-21 at 11:23 -0700, Warren Harris wrote: > I'm considering writing a moderate sized program with high performance > needs in a monad / monad transformer style in ocaml. Although I > believe that this abstraction will offer me benefits in hiding some > complexity, some of the monad transformers I would like to "stack" are > quite simple (e.g. a state-transition monad), and I'm concerned that > my program will be paying a high performance cost due to high function > call overhead -- ones which cannot be optimized away due to module > boundaries. > > I know that the real answer here is "profile it and find out"... but I > thought that asking for other's experience might be a good first step. > Perhaps someone can offer a technique to make this work well, or a > word of caution on why this should be avoided. I realize that most of > the monad work happens in haskell (and I sometimes feel that I'm > reinventing the wheel -- although it's very educational!), but I'd > prefer to stick with ocaml if possible. > > Warren > -- David Teller Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller Angry researcher: French Universities need reforms, but the LRU act brings liquidations.