Ad- and disad- vantages of OCaml.

"Hendrik Boom [email protected] [ocaml_beginners]" <[email protected]> Wed, 23 Mar 2016 14:25:09 -0400
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
On Wed, Mar 23, 2016 at 05:05:28PM +0000, Kenneth Miller [email protected] [ocaml_beginners] wrote:
> 
> Thinking about math isn't what very many people want to do with their 
> time because it's hard, you're going to have to acknowledge that. 
> Rigor is what it is: rigor.  

And rigor is necessary for any kind of reliable programming.  But don't 
confuse rigor with a strait-jacket.

The big advantage of languages like OCaml isn't that you have to use 
math; nor is it that it makes you think functionally.

It's that:

*  when your problem is naturally functional, the syntax allows 
you to use functional notation.

* It's strongly typed.  (This alone accounts for much of its 
reliability)

* It's syntactcally compact.

On the other hand,

* When your problem is naturally procedural, the syntax isn't as 
accomodating.

* It doesn't lend itself to handling detailed compact storage layouts 
for data, often needed by externally specified data structures and 
file layouts.  In particular, 
  * You lose a bit in every word of memory.

* Variables seem to require extra storage overhead in the form of a 
pointer to a separately allocated and garbage-collected storage.

* The syntactically compact style can be confusing when it leads 
programmers to leave out explicit typing of parameters and other 
names.

* The compiler only finds one error per compilation.  This could 
perhaps be obviated by a new compiler, but it's not clear that the 
language provides enough redundancy for useful syntactic error 
recovery.  (I'm using the word 'syntax' to include static typing)
 
-- hendrik