Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2006-12-21 (13:53)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Scripting in ocaml
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

> 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 <skaller at users dot sf dot net>
Felix, successor to C++: