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.1 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7D4C0BC0B for ; Fri, 15 Dec 2006 12:06:29 +0100 (CET) Received: from smtp19.orange.fr (smtp19.orange.fr [80.12.242.17]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBFB6QnA010934 for ; Fri, 15 Dec 2006 12:06:29 +0100 Received: from nono (AMontsouris-104-1-5-60.w80-11.abo.wanadoo.fr [80.11.105.60]) by mwinf1912.orange.fr (SMTP Server) with SMTP id B31041C00089 for ; Fri, 15 Dec 2006 12:06:25 +0100 (CET) X-ME-UUID: 20061215110625733.B31041C00089@mwinf1912.orange.fr Message-ID: <005501c7203a$17fd0b80$3c690b50@mshome.net> From: =?iso-8859-1?Q?Fr=E9d=E9ric_Gava?= To: References: <875c7e070612091935q2388092dr51538ff444d0e3a6@mail.gmail.com><20061210180426.GA5347@furbychan.cocan.org><875c7e070612101527j3d649226y3cade255af0cd6cd@mail.gmail.com> <20061211155513.GA22044@furbychan.cocan.org> Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad Date: Fri, 15 Dec 2006 12:13:47 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Miltered: at concorde with ID 458281B5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; gava:01 gava:01 'int:01 ocaml:01 computed:01 coq:01 ocaml:01 12.:98 exception:01 caml-list:01 caml-list:01 assert:01 functions:01 functions:01 exceptions:01 ----- Original Message ----- From: "Richard Jones" To: "Chris King" Cc: Sent: Monday, December 11, 2006 4:55 PM Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad >Perhaps though this is an argument that List.find and friends should >be returning 'a option, not an argument for all exceptions being bad. Hi all, There is also many case where exceptions are faster than 'a option. Could you imagine a program where (/) returns 'int option because 1/0 is impossible ? Could you benchmark serioulsy a OCaml matrix multiplication again C where Array.get return 'a option and that you have all the time to match the result ? Exceptions are goods for performance, easy to manipulate (except in tail-recursive functions) and understand. Return all the time 'a option thinks to me C programs where functions return 1 if it has been well computed or 0 otherwise (you all the time checked if it is 0 or 1 but with execption you just write try ... with on the block of functions). The case of Coq is another thinks because you can restric the cases using high level specification (and in this case, when you extract the proof in ocaml code you have "assert false"...an exception...arg.) Frédéric Gava