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=none 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 AF4E1BC0A for ; Fri, 22 Dec 2006 13:19:39 +0100 (CET) Received: from mail17.bluewin.ch (mail17.bluewin.ch [195.186.18.64]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBMCJdLv031243 for ; Fri, 22 Dec 2006 13:19:39 +0100 Received: from [10.0.1.2] (85.1.98.201) by mail17.bluewin.ch (Bluewin 7.3.118) id 457D6B3400354168; Fri, 22 Dec 2006 12:19:39 +0000 In-Reply-To: <20061221221650.GL9440@apotheon.com> 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> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <3EC73FC3-41A6-4FB1-9549-29286A6568CC@epfl.ch> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml) Date: Fri, 22 Dec 2006 13:21:07 +0100 To: Chad Perrin , Jon Harrop X-Mailer: Apple Mail (2.752.2) X-Miltered: at concorde with ID 458BCD5B.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bunzli:01 buenzli:01 ocaml:01 avoided:01 statically:01 compilation:01 abstractions:01 high-level:01 abstractions:01 language's:01 higher-level:01 statically:01 haskell:01 ocaml:01 wikipedia:01 Le 21 d=E9c. 06 =E0 23:16, Chad Perrin a =E9crit : > I mean that it doesn't allow you to go around doing in-place type > changes willy-nilly the way something like C does. (Well in fact you can with Obj.magic, but that's not my point) The problem is that this weak/strong terminology is hopelessly =20 confused (see [1],[2]). Since there is no clear unique definition of =20 strong/weak typing I think this terminology should be avoided. I tend =20= to favour the definitions you can find in the introduction of this =20 book [3] which are imho less confusing. Basically the author distinguishes on one hand between statically and =20= dynamically typed languages, and on the other hand, between safe and =20 unsafe languages. Static and dynamic type checking refers to whether type checks are =20 respectively performed at compilation or run time. Safety is broadly defined as follows : "A safe language is one that protects its own abstractions. Every =20 high-level language provides abstractions of machine services. Safety =20= refers to the language's ability to guarantee the integrity of these =20 abstractions and of higher-level abstractions introduced by the =20 programmer using the definitional facilities of the language" Later he gives the following chart |Statically checked | Dynamically checked ------------------------------------------------- safe | ML, Haskell, Java, etc. | Lisp, Scheme, Perl, Postscript, etc unsafe | C, C++, etc. | Subsequently he adds : "Language safety is seldom absolute. Safe languages often offer =20 programmers "escape hatches", such as foreign function calls to code =20 written in other, possibly unsafe, languages. Indeed such escape =20 hataches are sometimes provided in a controlled from within the =20 language itself--Obj.magic in Ocaml, ... " These are just definitions. But it is hard to argue when words do not =20= have a common meaning between arguers. I just think these definitions =20= make it simpler to have a common understanding of what we are talking =20= about. Best, Daniel [1] [2] [3] =