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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D96DCBC0A for ; Fri, 22 Dec 2006 20:42:07 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBMJg5Mw004157 for ; Fri, 22 Dec 2006 20:42:07 +0100 Received: from ppp14-213.lns2.syd7.internode.on.net (HELO rosella) ([59.167.14.213]) by ipmail02.adl2.internode.on.net with ESMTP; 23 Dec 2006 06:12:04 +1030 X-IronPort-AV: i="4.12,205,1165152600"; d="scan'208"; a="63804002:sNHT36324022" Subject: Re: strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml) From: skaller To: Daniel =?ISO-8859-1?Q?B=FCnzli?= Cc: caml-list@yquem.inria.fr In-Reply-To: <4E1EAAC5-DC08-4A55-9AEB-0D5D3BE1C0EA@epfl.ch> References: <6dbd4d000612201941wcd4b09anc503a13889576512@mail.gmail.com> <20061221153413.8f99e8ed.mle+ocaml@mega-nerd.com> <1166685756.5337.4.camel@rosella.wigram> <458A8C7B.7050204@hq.idt.net> <1166709162.5653.11.camel@rosella.wigram> <458AA143.3090303@hq.idt.net> <20061221202520.GG9440@apotheon.com> <20061221221650.GL9440@apotheon.com> <3EC73FC3-41A6-4FB1-9549-29286A6568CC@epfl.ch> <1166811403.6555.46.camel@rosella.wigram> <4E1EAAC5-DC08-4A55-9AEB-0D5D3BE1C0EA@epfl.ch> Content-Type: text/plain; charset=utf-8 Date: Sat, 23 Dec 2006 06:42:02 +1100 Message-Id: <1166816522.7448.45.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 458C350D.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 0100,:01 ocaml:01 bug:01 abstraction:01 bounded:01 dumped:01 protects:98 sourceforge:01 arbitrary:01 wrote:01 typing:01 exception:01 exception:01 caml-list:01 On Fri, 2006-12-22 at 19:47 +0100, Daniel Bünzli wrote: > Le 22 déc. 06 à 19:16, skaller a écrit : > > > It is also unclear what you mean by 'unsafe'. > > > > Ocaml is not safe: > > > > let a = Array.create 0 0 in > > let y = a.[99] in (* WOOPS *) > > > > The fact that an exception is thrown may or may not > > make the language safe depending on whether or not > > you INTEND to trigger an exception. The best you can > > say is that if you don't catch it, its a bug. > > I'm sorry I don't follow you. This would be an example of safety  > according to the definition I gave. Ocaml protects its array > abstraction -- which allows to look at a bounded piece of memory as a > finite array of values of a certain type -- by raising an exception > if you try to access out of the bounds of the memory instead of > silently running the program with the arbitrary data it got by > reading out of bounds. This is not my understanding of what safe means. Your program is safe? Ok, so would you use it to control a nuclear reactor? Do you really think anyone cares if the reactor blows, whether the program core dumped, failed to core dump, or threw an exception? to me safe means 'cannot fail'. But perhaps i misunderstand: it would be interesting to see another definition. -- John Skaller Felix, successor to C++: http://felix.sf.net