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 D93C0BC0A for ; Mon, 11 Dec 2006 00:27:38 +0100 (CET) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBANRbjY004520 for ; Mon, 11 Dec 2006 00:27:38 +0100 Received: by wx-out-0506.google.com with SMTP id i31so1390351wxd for ; Sun, 10 Dec 2006 15:27:37 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UUMQJOer7mquSyWxNg6SgONX+ZGlOjZe8wnVQ26dqtpRQi0lQGy88HbKnCkH+tuZ2SwRb7p90uHSpWM4ShcK4grLlRsTZa8uVk2vl3avHqSiBLsyOqua2H44iF7yUznfowpLmKslscEG/TadzB07fjhJW0tJxVEEIQogk+uYSEA= Received: by 10.90.78.9 with SMTP id a9mr6288023agb.1165793257556; Sun, 10 Dec 2006 15:27:37 -0800 (PST) Received: by 10.90.115.2 with HTTP; Sun, 10 Dec 2006 15:27:37 -0800 (PST) Message-ID: <875c7e070612101527j3d649226y3cade255af0cd6cd@mail.gmail.com> Date: Sun, 10 Dec 2006 18:27:37 -0500 From: "Chris King" To: "Richard Jones" Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad Cc: caml-list@inria.fr In-Reply-To: <20061210180426.GA5347@furbychan.cocan.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <875c7e070612091935q2388092dr51538ff444d0e3a6@mail.gmail.com> <20061210180426.GA5347@furbychan.cocan.org> X-j-chkmail-Score: MSGID : 457C97EA.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 457C97EA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; o'caml:01 whereby:01 compiler:01 inference:01 o'caml:01 wrote:01 wrote:01 exception:01 exception:01 caml-list:01 exceptions:01 exceptions:01 inferred:02 programming:03 languages:03 On 12/10/06, Richard Jones wrote: > On Sat, Dec 09, 2006 at 10:35:56PM -0500, 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. > > Oh please no! Checked exceptions are the dumbest and most frustrating > feature of Java (and that's saying something - the Java language has > far more frustrations than most programming languages). I fully agree. Forcing the programmer to acknowledge the presence of every possible exception is annoying to write and makes for fragile code. Hence I suggested exception inference... no extra effort is required on the part of the programmer and the code is not made fragile. O'Caml provides the safety of checked types without the hassle of type declarations; in the same way it could provide the safety of checked exceptions without the hassle of exception declarations. - Chris