From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 75320BBAF for ; Mon, 22 Nov 2010 14:43:26 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkEAG8C6kxQW+UMgWdsb2JhbACUUI4FFQEBFiIiiCu0F4VLBIpehX0 X-IronPort-AV: E=Sophos;i="4.59,236,1288566000"; d="scan'208";a="80692084" Received: from lo.gmane.org ([80.91.229.12]) by mail2-smtp-roc.national.inria.fr with ESMTP; 22 Nov 2010 14:43:26 +0100 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PKWg0-0001dG-5O for caml-list@inria.fr; Mon, 22 Nov 2010 14:43:24 +0100 Received: from avelizy-155-1-41-182.w83-204.abo.wanadoo.fr ([83.204.200.182]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Nov 2010 14:43:24 +0100 Received: from sylvain by avelizy-155-1-41-182.w83-204.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Nov 2010 14:43:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: Is OCaml fast? Date: Mon, 22 Nov 2010 13:43:12 +0000 (UTC) Message-ID: References: X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: avelizy-155-1-41-182.w83-204.abo.wanadoo.fr User-Agent: slrn/pre1.0.0-18 (Linux) X-Spam: no; 0.00; le-gall:01 ocaml:01 ocaml:01 haskell:01 ubc:98 wrote:01 executables:01 algorithm:01 variables:02 shootout:02 shootout:02 algorithmic:02 bugs:03 languages:03 debian:04 Hello, On 22-11-2010, Thanassis Tsiodras wrote: > I apologize beforehand if this is not the forum to ask. > > I am on the fence about whether to learn OCaml or not, and while > reading an article called "Why OCaml" > (http://www.cs.ubc.ca/~murphyk/Software/Ocaml/why_ocaml.html), 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++. > > 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#... > (http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php) Shootout benchmarks doesn't always allow to set some variables that could greatly improve the speed of OCaml. > > Is it just hype, then? Or am I missing something? > You could write very fast application with OCaml -- even beating C code in some case. But what OCaml is really helpful for, is that you can do algorithmic optimizations that improve the speed. It means that OCaml is terse enough to allow you to write complex algorithm without making too much bugs. All in all: development time + execution time is fast. But if you spend 10x development time on the same C code, you will obviously get something faster in C. Regards, Sylvain Le Gall