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 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 988FEBC0A for ; Thu, 21 Dec 2006 15:56:11 +0100 (CET) Received: from mta2.srv.hcvlny.cv.net (mta2.srv.hcvlny.cv.net [167.206.4.197]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBLEu98v003156 for ; Thu, 21 Dec 2006 15:56:11 +0100 Received: from [192.168.15.101] (ool-457da870.dyn.optonline.net [69.125.168.112]) by mta2.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTP id <0JAM00GSXPHLKJT0@mta2.srv.hcvlny.cv.net> for caml-list@inria.fr; Thu, 21 Dec 2006 09:56:09 -0500 (EST) Date: Thu, 21 Dec 2006 09:59:15 -0500 From: Serge Aleynikov Subject: Re: [Caml-list] Scripting in ocaml In-reply-to: <1166709162.5653.11.camel@rosella.wigram> To: skaller Cc: caml-list@inria.fr Message-id: <458AA143.3090303@hq.idt.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT 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> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) X-Miltered: at concorde with ID 458AA089.003 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 bug:01 ocaml:01 intentional:01 run-time:01 erlang:01 compilation:01 checker:01 run-time:01 reloading:01 computations:01 wrote:01 wrote:01 typing:01 typing:01 skaller wrote: > On Thu, 2006-12-21 at 08:30 -0500, Serge Aleynikov wrote: >> skaller wrote: > >>> As one of the authors of several major pieces of Python, >>> my comment is that whilst it provides great convenience >>> and good code structure .. dynamic typing just doesn't >>> scale. >> Could you please illustrate your point by more concrete reasoning. > > It isn't a matter of reasoning but experience. Many people believe > static typing is good because it improves the likelihood a program > is correct, perhaps by making it easier for both the human and > machine to reason about the code -- and in particular catch > errors which would otherwise require testing, and even then > the actual location of a bug might be hard to determine. OCaml has static typing but doesn't provide an actual location of code in exceptions. Is it because it was hard or intentional? > I guess the arguments for static typing and scalability are > well known. So the reasoning part is clear: we infer larger > programs without dynamic typing are harder to get right. I agree with your statements applicable to imperative/OO dynamicly typed languages. However if a dynamic language is functional, this makes it possible to provide run-time static analysis to identify type related bugs and unreachable code. An example of this is the Dyalizer tool for Erlang. In this case running such a tool after compilation reveals the same problems that a compile-level static checker would do, but allows for run-time code reloading, more safe term serialization/deserialization, and safer cross-language integration. Needless to say, this benefits comes at price of efficiency, but there are many cases when these features out-weight a reasonable performance loss that can be regained by parallelizing computations. > Sorry, I wasn't clear. I meant to refer to dynamic loading in Ocaml, > not in general. Exactly why that is I don't know. Perhaps the > interaction of the static typing and dynamic loading is not > easy because it is not well understood how to make it so, > in Ocaml, and perhaps in general (without losing type safety) I believe that introducing strict typing in the language might help in bridging static typing and dynamic loading. Strict typing would allow to do run-time type verification and type-specific guard checks. Though, this would no longer be Ocaml as we know it today. ;-) Serge