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 298D4BBAF for ; Mon, 22 Nov 2010 14:42:35 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgAAG8C6kyYToALlGdsb2JhbACDSp8LFQEBAQEJCwgJEQUdq3yQRoEigzZzBIpegwIMBg X-IronPort-AV: E=Sophos;i="4.59,236,1288566000"; d="scan'208";a="80691933" Received: from mailgate6.iss.soton.ac.uk ([152.78.128.11]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Nov 2010 14:42:34 +0100 Received: from mailgate6.iss.soton.ac.uk (localhost.localdomain [127.0.0.1]) by mailgate6.iss.soton.ac.uk (8.13.8/8.13.4) with ESMTP id oAMDgPLH008806; Mon, 22 Nov 2010 13:42:25 GMT Received: from UOS-MSG00010-SI.soton.ac.uk (uos-msg00010-si.soton.ac.uk [152.78.119.33]) by mailgate6.iss.soton.ac.uk (mailgate6.iss.soton.ac.uk [152.78.128.11]) envelope-from with ESMTP id mALDgP1320310412z7 ret-id none; Mon, 22 Nov 2010 13:42:25 +0000 Received: from [152.78.97.184] (152.78.97.184) by smtp.soton.ac.uk (152.78.119.33) with Microsoft SMTP Server (TLS) id 8.2.213.0; Mon, 22 Nov 2010 13:42:25 +0000 Message-ID: <4CEA7341.2020702@soton.ac.uk> Date: Mon, 22 Nov 2010 13:42:25 +0000 From: Thomas Fischbacher User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: Gregory Bellier Cc: Thanassis Tsiodras , "caml-list@yquem.inria.fr" Subject: Re: [Caml-list] Is OCaml fast? References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-smtpf-Report: sid=mALDgP132031041200; tid=mALDgP1320310412z7; client=relay,white,ipv6; mail=; rcpt=; nrcpt=3:0; fails=0 X-UOS-MailScanner-Information: Please contact Serviceline@soton.ac.uk for more information X-UOS-MailScanner-ID: oAMDgPLH008806 X-UOS-MailScanner: Found to be clean X-UOS-MailScanner-From: t.fischbacher@soton.ac.uk X-Spam: no; 0.00; ocaml:01 branching:01 compiler:01 compiler:01 o'caml:01 segfault:01 ocaml:01 closures:01 wrote:01 caml-list:01 delayed:01 ghc:01 imperative:01 lisp:02 native:03 Gregory Bellier wrote: > If you want speed then you should learn assembly or choose C as a second > choice. Certainly not assembly. Modern microprocessors just see assembly as a kind-of high level language which they interpret in a funny way, doing all sorts of re-schedulings, register renamings, delayed branching, speculative execution etc. Producing code that can take advantage of this is best left to the compiler - unless one has to deal with instruction set extensions for which there is no good compiler support yet. > It depends on the kind of apps you'd like to write. Even though O'Caml > is fast, it's not the first criteria I have in mind which would be > security : no segfault, no need to handle horrible stuff like in C, ... I'd say the OCaml native compiler is reasonably fast for pretty much all applications that need the speed of compiled code. But I'd say the same for GHC and SBCL, say. There are some good reasons to take a closer look at OCaml, but these are related to other qualities of the language. In my view, its greatest benefit is that it makes working with closures simple while being fast and by far not as intimidating to (prospective) PhD students as Scheme/Lisp (but that only because most of them have been spoilt by imperative languages beforehand). -- best regards, Thomas Fischbacher t.fischbacher@soton.ac.uk