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.2 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE 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 D04EDBBAF for ; Fri, 25 Jul 2008 22:31:41 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqMAACDViUjUGyoemWdsb2JhbACSWAEBAQEBCAUGCREDnQs X-IronPort-AV: E=Sophos;i="4.31,253,1215381600"; d="scan'208";a="13460664" Received: from smtp4-g19.free.fr ([212.27.42.30]) by mail2-smtp-roc.national.inria.fr with ESMTP; 25 Jul 2008 22:31:41 +0200 Received: from smtp4-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp4-g19.free.fr (Postfix) with ESMTP id 3690B3EA0BB; Fri, 25 Jul 2008 22:31:41 +0200 (CEST) Received: from [192.168.17.1] (ivr94-8-88-162-26-239.fbx.proxad.net [88.162.26.239]) by smtp4-g19.free.fr (Postfix) with ESMTP id 0750E3EA0B0; Fri, 25 Jul 2008 22:31:40 +0200 (CEST) Message-ID: <488A382B.6050303@users.sourceforge.net> Date: Fri, 25 Jul 2008 22:31:39 +0200 From: Zheng Li User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 Newsgroups: gmane.comp.lang.caml.inria To: Dawid Toton Cc: caml-list@yquem.inria.fr Subject: Re: 'Nondeterministic' evaluation wrt exceptions References: <4889F16B.3020903@uj.edu.pl> <4889FD30.9070005@inria.fr> <488A2988.3070402@uj.edu.pl> In-Reply-To: <488A2988.3070402@uj.edu.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; async:01 sourceforge:01 wrote:01 pps:01 computation:01 exceptions:01 jussieu:01 seems:03 unit:03 asynchronous:03 programming:03 library:03 let:03 let:03 translate:04 Hi, Dawid Toton wrote: > Thank you all for quick answers! > > Let me show an example of what I exactly mean. I start with a code: > > 1: let a = heavy 1 > 2: let b = heavy 2 > 3: let c = report (a + b) > 4: let d = heavy 4 > 5: let e = heavy d > > Then I want to translate it automatically so that three applications of > heavy are evaluated (lines 1, 2, 4). The addition a + b won't be > evaluated untill a and b are successfully returned. I'm not clear about what you want. It seems that you're doing asynchronous parallel programming. I have a Async library, which is not yet released (needs polish). It allows you express the logic like let c = Future { let! a = heavy 1 in let! b = heavy 2 in return (a + b) } let e = Future { let! d = heavy 4 in heavy d } or let c = Future { let! a = spawn heavy 1 in let! b = spawn heavy 2 in return (a + b) } let e = Future { let! d = spawn heavy 4 in spawn heavy d } if you intend to assign specific computing unit for some heavy computation. I hope to release it in the summer, but don't hold your breath. If you're in a hurry, you should turn to other libraries instead. (There exist a few of them doing the similar thing, but I can't remember the accurate information.) HTH. -- Zheng Li http://www.pps.jussieu.fr/~li