From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 B26ADBC32 for ; Thu, 17 Mar 2005 04:48:51 +0100 (CET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2H3momr012252 for ; Thu, 17 Mar 2005 04:48:51 +0100 Received: by wproxy.gmail.com with SMTP id 67so112544wri for ; Wed, 16 Mar 2005 19:48:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=YdKttOWgzORAoys/yRk3XS96ZYMD5N6asF+ctkZRT7/1QHJjMwNnXBtQZHdXvIoaEJaTijzxbm4nMzkxwf5eFdSbpmRqSKB5uQSAcdFjr3qgBx5r5S0kyPigs4SDHYYBC6Oig17LaP0yfocN88Q5W0jw2y/3TzcM6o0pY25iUIc= Received: by 10.54.29.61 with SMTP id c61mr1555588wrc; Wed, 16 Mar 2005 19:48:50 -0800 (PST) Received: by 10.54.2.79 with HTTP; Wed, 16 Mar 2005 19:48:50 -0800 (PST) Message-ID: <891bd33905031619484825e276@mail.gmail.com> Date: Wed, 16 Mar 2005 22:48:50 -0500 From: Yaron Minsky Reply-To: yminsky@cs.cornell.edu To: brogoff Subject: Re: [Caml-list] OCaml troll on Slashdot Cc: caml-list@yquem.inria.fr In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <20050316001819.GB347@first.in-berlin.de> <20050316.224108.35690658.garrigue@math.nagoya-u.ac.jp> <200503161951.48923.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 4238FE22.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 caml-list:01 ocaml:01 stack:01 ocaml:01 inlining:01 yaron:01 wrote:01 structures:01 rewrite:01 exceptions:01 functions:01 speakeasy:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, 16 Mar 2005 19:35:17 -0800 (PST), brogoff wrote: > Anyways, long lists do occur, and Stack_overflow at the customer site sucketh > bigtime. I completely agree. As someone who makes extensive use of OCaml in a business setting, the fact that the standard libraries throw exceptions on large data structures is a real pain. It's a violation of the principle of least surprise, and I've run into it in practice quite a few times. Our solution was to just rewrite the list module with tail-recursive versions. We're happy to make the performance tradeoff. If we really want things to be fast, List.map is no good anyway, due to the lack of inlining of the function parameter. I do think that it would be a great thing if the tail-recursive list functions were moved into the standard library. Yaron