Version française
Home     About     Download     Resources     Contact us    
Browse thread
Scripting in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Scripting in ocaml
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 <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net