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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 47445BC0A for ; Mon, 11 Dec 2006 01:18:21 +0100 (CET) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.239]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBB0IKcg020766 for ; Mon, 11 Dec 2006 01:18:20 +0100 Received: by wx-out-0506.google.com with SMTP id i26so1478931wxd for ; Sun, 10 Dec 2006 16:18:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=AmILmaQLBuwydt0ITfIWMKAZbwGkJ1APof6l2ZGcB0PAzJWp16JHWeNUSAyec1D88kRmmFKBKXBkMjz6wnPt+d9IYVg3Numf2wW0OjKF17bVGsxkV7EFvcdnWrRP2W2+FqonpaaquH/YibGPQzJv+MuxJKWezg6Homj+y+3d+AY= Received: by 10.90.105.19 with SMTP id d19mr6242443agc.1165796297979; Sun, 10 Dec 2006 16:18:17 -0800 (PST) Received: by 10.90.115.2 with HTTP; Sun, 10 Dec 2006 16:18:17 -0800 (PST) Message-ID: <875c7e070612101618s40c749capd26750eaf40fc533@mail.gmail.com> Date: Sun, 10 Dec 2006 19:18:17 -0500 From: "Chris King" To: "Jon Harrop" Subject: Exception inferrence (was: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad) Cc: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-j-chkmail-Score: MSGID : 457CA3CC.004 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 457CA3CC.004 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; o'caml:01 whereby:01 compiler:01 ocamlexc:01 ocamlexc:01 inference:01 o'caml:01 compiler:01 wrote:01 wrote:01 exception:01 exception:01 caml-list:01 exceptions:01 exceptions:01 (Changed the subject to avoid highjacking Brian's thread more than I already have...) On 12/10/06, Jon Harrop wrote: > On Sunday 10 December 2006 03:35, Chris King wrote: > > One thing Java (sort of) gets right is keeping track of which > > exceptions a function can throw, making it easy to ensure that some > > deeply nested piece of code won't cause the entire application to die > > from some obscure exception. I'd love to see a similar feature in > > O'Caml, whereby the exceptions which a function can raise are part of > > its type and are inferred and checked by the compiler. > > This has been done. There was a tool called ocamlexc that did whole-program > analysis to find out which exceptions could propagate where. However, it > wasn't useful enough to be kept up to date. > > http://caml.inria.fr/pub/old_caml_site/ocamlexc/ocamlexc.htm Hah, I feel foolish... the bottom of that page links [1] to a paper co-authored by Xavier Leroy himself describing an exception inference system for O'Caml. I wonder if it has been considered for inclusion in the compiler, and, if so, why it was rejected? - Chris