caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chad Perrin <perrin@apotheon.com>
To: skaller <skaller@users.sourceforge.net>
Cc: Chad Perrin <perrin@apotheon.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Scripting in ocaml
Date: Thu, 21 Dec 2006 13:21:15 -0700	[thread overview]
Message-ID: <20061221202115.GF9440@apotheon.com> (raw)
In-Reply-To: <1166696955.5372.8.camel@rosella.wigram>

On Thu, Dec 21, 2006 at 09:29:15PM +1100, skaller wrote:
> 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!

Actually, I typically don't even use variables in small OCaml scripts.
I occasionally use "let n =", but don't find need to do the reference
thing very often when the body of code is kept small.

The most common problem I have with static typing getting in the way is
having to decide on either multiple print statements or constructing a
string from several different data types to use a single print
statement.  Where something like that takes one short line of code in
the dynamically typed languages I'm used to using, it can be half my
code when doing something similar in an OCaml script.

Plus, y'know, list handling is easier for me in Perl or UCBLogo, with
the former providing better general purpose text processing capability
and the latter having an attractive prefix notation functional syntax
(among other benefits).  Neither compiles to persistent executable
native binaries, though, which (combined with its high level syntax and
several other means of running OCaml code) is really my main reason for
liking OCaml.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
print substr("Just another Perl hacker", 0, -2);


  reply	other threads:[~2006-12-21 20:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21  3:41 Denis Bueno
2006-12-21  4:34 ` [Caml-list] " Erik de Castro Lopo
2006-12-21  7:22   ` skaller
2006-12-21  9:12     ` Till Varoquaux
2006-12-21  9:18     ` Chad Perrin
2006-12-21 10:29       ` skaller
2006-12-21 20:21         ` Chad Perrin [this message]
2006-12-21 13:30     ` Serge Aleynikov
2006-12-21 13:52       ` skaller
2006-12-21 14:59         ` Serge Aleynikov
2006-12-21 20:25           ` Chad Perrin
2006-12-21 20:41             ` Daniel Bünzli
2006-12-21 22:16               ` Chad Perrin
2006-12-22 12:21                 ` strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml) Daniel Bünzli
2006-12-22 16:51                   ` Tom
2006-12-22 17:34                     ` Daniel Bünzli
2006-12-22 18:16                     ` skaller
2006-12-22 18:47                       ` Daniel Bünzli
2006-12-22 19:42                         ` skaller
2006-12-22 20:03                           ` David Brown
2006-12-22 20:17                             ` Chad Perrin
2006-12-23  3:48                               ` skaller
2006-12-23  4:11                                 ` Chad Perrin
2006-12-22 20:19                           ` Chad Perrin
2006-12-23 12:58                           ` Daniel Bünzli
2006-12-23 16:06                             ` Chad Perrin
2006-12-23 21:50                               ` Tom
2006-12-26  6:10                                 ` Chad Perrin
2006-12-22 20:14                   ` Chad Perrin
2006-12-21 21:11             ` [Caml-list] Scripting in ocaml Serge Aleynikov
2006-12-21 21:27               ` Philippe Wang
2006-12-21 22:06                 ` Serge Aleynikov
2006-12-22 12:35                 ` Jon Harrop
2006-12-21 22:19               ` Chad Perrin
2006-12-22 12:37                 ` Jon Harrop
2006-12-22 18:52                   ` Chad Perrin
2006-12-22  2:51               ` skaller
2006-12-22 15:20                 ` Jon Harrop
2006-12-22 11:32               ` Jon Harrop
2006-12-23 18:50           ` Jon Harrop
2006-12-24  0:15             ` Serge Aleynikov
2006-12-24  3:30             ` skaller
2006-12-21 14:59 ` Richard Jones
2006-12-21 20:27   ` Chad Perrin
2006-12-21 23:35   ` Martin Jambon
2006-12-26 17:14 ` Aleksey Nogin
2006-12-26 23:36   ` Ian Zimmerman
2006-12-27 18:25     ` Aleksey Nogin
2006-12-27 18:39       ` Richard Jones
2006-12-27 19:20         ` Aleksey Nogin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061221202115.GF9440@apotheon.com \
    --to=perrin@apotheon.com \
    --cc=caml-list@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).