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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 61E18BC0C for ; Thu, 21 Dec 2006 11:29:23 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBLATLkT011367 for ; Thu, 21 Dec 2006 11:29:22 +0100 Received: from ppp14-213.lns2.syd7.internode.on.net (HELO rosella) ([59.167.14.213]) by ipmail02.adl2.internode.on.net with ESMTP; 21 Dec 2006 20:59:19 +1030 X-IronPort-AV: i="4.12,197,1165152600"; d="scan'208"; a="63295307:sNHT25892244" Subject: Re: [Caml-list] Scripting in ocaml From: skaller To: Chad Perrin Cc: caml-list@inria.fr In-Reply-To: <20061221091824.GF2565@apotheon.com> References: <6dbd4d000612201941wcd4b09anc503a13889576512@mail.gmail.com> <20061221153413.8f99e8ed.mle+ocaml@mega-nerd.com> <1166685756.5337.4.camel@rosella.wigram> <20061221091824.GF2565@apotheon.com> Content-Type: text/plain Date: Thu, 21 Dec 2006 21:29:15 +1100 Message-Id: <1166696955.5372.8.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 458A6201.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 bytecode:01 syntax:01 syntax:01 statically:01 cetera:98 sourceforge:01 wrote:01 wrote:01 dynamically:01 typing:01 typing:01 behaviour:01 caml-list:01 On Thu, 2006-12-21 at 02:18 -0700, Chad Perrin wrote: > On Thu, Dec 21, 2006 at 06:22:36PM +1100, skaller wrote: > > 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). > > Actually, I find that static typing is the biggest problem I have with > administration script writing in OCaml. It can be great for bigger > projects where dynamic typing doesn't always scale (as you mentioned), > but for something under thirty lines of code (to pick a number out of > thin air) the syntax requirements imposed by static typing and the > semantic gymnastics that must sometimes be done (string_of_int, et > cetera) can get in the way a bit. If you examine your scripting code I'm going to bet you find that most variables actually have a single statically known type! What I find with useful with Python code is stuff like: (a) exec/eval of loaded strings into executable code (b) scope control, turning dictionaries into scopes to modify the behaviour of script This is indeed dynamics .. and requires dynamic typing, but it isn't really that variables have a changing type, it seems more about the ability of a system to extend itself dynamically. -- John Skaller Felix, successor to C++: http://felix.sf.net