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
Is OCaml fast?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-22 (13:55)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] Is OCaml fast?

> I am on the fence about whether to learn OCaml or not, and while
> reading an article called "Why OCaml"
> (,
> I saw that OCaml was praised for the speed of the executables it
> generates - and was referred to, speed-wise, as "second to none",
> except C and C++.

Yes, Ocaml is fast (more on that later), but you should consider speed
as just the icing in the cake.  Besides all the cool language features,
what makes me recommend Ocaml to people who -- like you -- may be on
the fence, is that among the not so mainstream languages, Ocaml is
perhaps the one people are more likely to stick with for actual work
after they get past the learning stage.  Remember that though Ocaml
favours the functional paradigm, it is flexible enough to support those
(few) situations where it actually makes sense to be imperative and/or
use an object oriented approach, and where a purely functional solution
is just intellectual masturbation.

> However, when I actually went to the Language Shootout page suggested
> in the article, I found out that OCaml is not 2nd, it is 13th, behind
> languages like Haskell and C#...
> (
> Is it just hype, then? Or am I missing something?

There's lies, damn lies, and shootout statistics.  Getting good performance
in Haskell is often something of a black art that baffles even gurus. In
contrast, Ocaml has very good "performance predictability".  Moreover, it
is possible to get good performance from fairly idiomatic Ocaml programmes,
whereas in other languages you may need to write ugly code which looks like
nothing one would write for elegance and sanity.

Best regards,
Dario Teixeira