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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id C8896BB9A for ; Fri, 28 Oct 2005 14:19:35 +0200 (CEST) Received: from pih-relay06.plus.net (fuzznuts.plus.net [212.159.14.133] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9SCJZRY031606 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 28 Oct 2005 14:19:35 +0200 Received: from [80.229.56.224] (helo=chetara) by pih-relay06.plus.net with esmtp (Exim) id 1EVTCn-0002hU-Fc for caml-list@yquem.inria.fr; Fri, 28 Oct 2005 13:19:33 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] OCaml efficiency/optimization? Date: Fri, 28 Oct 2005 13:15:20 +0100 User-Agent: KMail/1.7.2 References: <1130494903.8339.246224558@webmail.messagingengine.com> In-Reply-To: <1130494903.8339.246224558@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510281315.21425.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 43621757.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 recursion:01 frog:98 wrote:01 imho:01 tail:01 immutable:01 caml:02 caml:02 graphics:02 somewhere:02 objective:02 chapter:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Friday 28 October 2005 11:21, Tato Thetza wrote: > I've been reading over > http://caml.inria.fr/pub/docs/manual-ocaml/index.html and have learned > two things: > -lists are immutable and singly linked, which explains why 1::[2;3] is > valid while [2,3]::1 is not, and why its efficient. > -the proper way to ensure tail-recursive optimization > > question: are these and other optimizations documented somewhere > officially? I don't know if it classifies as "official", but my OCaml book has a chapter on optimisation that covers tail recursion. > I find it a little uncomfortable I've been learning OCaml > without knowning such internal details. Any secrets I should definitely > know if I were to use this language in production? We write high-performance OCaml programs for various different applications, including scientific computing and graphics. IMHO, OCaml is just like any other language with regard to optimisation. One important difference is that the OCaml community are very friendly and helpful, which makes it much easier to get accurate information when you need it. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists