
OCaml as a scripting language - 10ren
http://ocaml.janestreet.com/?q=node/80
======
a-priori
I'm sure Jane Street knows their stuff when it comes to OCaml... but this is
fluff. Some examples would be nice.

------
starkfist
It seems like OCaml is mostly dead and Jane Street is the only place it is
still used.

~~~
jaen
People from Mozilla, including Brendan Eich, creator of JavaScript, are
working on a new language called Rust. The compiler is written in OCaml.

<http://lambda-the-ultimate.org/node/4009>

------
mathgladiator
For sake of argument, how does the environment/type system determine if
something is a "real program" or "scalable" ?

~~~
chipsy
It's all about two things:

1\. Eliminating runtime errors(type mismatches, segmentation faults, and null
pointer exceptions are a few problems that have been hammered on a lot and in
some languages eliminated entirely). 2\. Being able to manage a large project
effectively. Things like build systems, code editors, debuggers, and perhaps
most of all, access to libraries/hardware for the problem domain.

Newer general-purpose languages(under ~5-10 years) tend to offer compelling
features in the first case, but almost nothing in the second, which makes a
commercial project in them an expensive prospect.

------
sigzero
If I was going to delve into another language why would it be OCaml over
Haskell or Scheme?

~~~
mhd
There are some practical reasons, but if you haven't learned any of them, it's
hard to recommend Caml. Both Haskell and Scheme (and I'd add Prolog) offer
some interesting ways of reasoning about programs, even if you don't end up
working with them in the end.

As for usage scenarios: Compared to Scheme, you might like the syntax more,
it's statically typed and has a very fast compiler that doesn't even need to
use C as an intermediate language. Haskell is much more pure regarding its
functional nature and thus its way of interacting with a state-ful world can
seem a bit intimidating. If you don't have a lot of math under your belt,
Caml's way of interpreting code is a bit easier to mentally model.

I've always thought of ML as the C to Haskell/Miranda's Pascal, for better or
worse…

Library-wise, Caml has a very good foundation for writing Unix software.
Haskell has made major steps in catching up, Scheme is still a bit balkanized
(going from your teaching language to the Chicken/Gambit/PLT infrastructure is
not much easier thank taking up Common Lisp).

I'm still surprised at how far Haskell has come in recent years in getting
more libraries. It used to be slightly below Common Lisp in that regard, if my
memory serves me. Now Hackage is huge. GHC always was a pretty good compiler,
so nothing major about the language or its implementation changed. I also know
of no big poster boy use cases, compared to e.g. Erlang. Linux hackers
impressed by xmonad?

------
isnoteasy
As they use OCaml a lot, they are determined to used for everything and will
overcome any difficulty, so they will succeed. Scripting is not a high barrier
for such determined persons.

