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 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9BFD2BC0A for ; Thu, 21 Dec 2006 14:53:08 +0100 (CET) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBLDr6qq008435 for ; Thu, 21 Dec 2006 14:53:07 +0100 Received: from rosella (ppp14-213.lns2.syd7.internode.on.net [59.167.14.213]) by ash25e.internode.on.net (8.13.6/8.13.5) with ESMTP id kBLDqhbQ044569; Fri, 22 Dec 2006 00:22:47 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Scripting in ocaml From: skaller To: Serge Aleynikov Cc: caml-list@inria.fr In-Reply-To: <458A8C7B.7050204@hq.idt.net> References: <6dbd4d000612201941wcd4b09anc503a13889576512@mail.gmail.com> <20061221153413.8f99e8ed.mle+ocaml@mega-nerd.com> <1166685756.5337.4.camel@rosella.wigram> <458A8C7B.7050204@hq.idt.net> Content-Type: text/plain Date: Fri, 22 Dec 2006 00:52:42 +1100 Message-Id: <1166709162.5653.11.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 458A91C2.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 bug:01 abstracting:01 erlang:01 ocaml:01 bytecode:01 syntax:01 sourceforge:01 wrote:01 wrote:01 typing:01 typing:01 caml-list:01 purely:02 functional:02 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. 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. That has indeed been my experience. For small programs I can see all at once on the screen, dynamic typing is ok. For larger programs, the type system seems to help by abstracting the code, so even the larger bulk of code can be scanned and remembered as a whole, if not in detail. I guess static typing allows some kind of divide-and-conquer approach. > Erlang uses dynamic typing (or rather strict typing) and scales very well. Perhaps that is because it is purely functional? > > The big problem using Ocaml (bytecode) for scripting > > is probably the ugly dynamic loading support, and > > for long running systems, the lack of unloading support. > > (plus the syntax which isn't really well suited to small > > scale scripting applications). > > Why is dynamic loading ugly? 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) -- John Skaller Felix, successor to C++: http://felix.sf.net