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 CA252BB84 for ; Fri, 19 May 2006 21:36:14 +0200 (CEST) Received: from eigen.apisnetworks.com (eigen.apisnetworks.com [67.15.52.22]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k4JJaCie015341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 May 2006 21:36:14 +0200 Received: from mail.akalin.cx (localhost.localdomain [127.0.0.1]) by eigen.apisnetworks.com (8.12.11.20060308/8.12.10) with ESMTP id k4JJaAXo023136; Fri, 19 May 2006 15:36:10 -0400 Received: from 207.171.180.101 (SquirrelMail authenticated user akalin@akalin.cx); by mail.akalin.cx with HTTP; Fri, 19 May 2006 15:36:10 -0400 (EDT) Message-ID: <58530.207.171.180.101.1148067370.squirrel@207.171.180.101> In-Reply-To: <200605191315.33165.jon@ffconsultancy.com> References: <20060515141230.ajyupn2z28k0484s@horde.akalin.cx> <446986DF.1070308@inria.fr> <446D5E4A.8060005@akalin.cx> <200605191315.33165.jon@ffconsultancy.com> Date: Fri, 19 May 2006 15:36:10 -0400 (EDT) Subject: Re: [Caml-list] Array 4 MB size limit From: akalin@akalin.cx To: "Jon Harrop" Cc: caml-list@yquem.inria.fr User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Miltered: at nez-perce with ID 446E1E2D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; arrays:01 assertion:01 surprising:01 arrays:01 vectors:01 reuse:01 vectors:01 triangles:01 scalable:01 2006:98 wrote:01 caml-list:01 abstract:01 dynamically:01 encode:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.3 > On Friday 19 May 2006 06:57, Frederick Akalin wrote: >> > A better idea would be to determine exactly what data structure you >> need: >> > which abstract operations, what performance requirements, etc. C++ >> > and Lisp programmers tend to encode everything as arrays or lists, >> > respectively, but quite often these are not the best data structure >> > for the application of interest. >> >> I find your assertion surprising. C++ and Common LISP are by no means >> lacking in standard data structures (and using bare arrays is >> discouraged in C++, as far as I know) and in my experience I haven't >> much seen C++ code that used arrays/vectors when not appropriate. > > Yes, I would say that C and Fortran programmers overuse arrays because > other > data structures are prohibitively difficult to implement and reuse. I would agree with you on your statement about C and Fortran. However, I was talking about C++, which has now grown far beyond its "C with Classes" legacy. C++'s standard library includes all of the most common data structures (maps, vectors, lists), so you'd have to go out of your way to use arrays for everything. >> In any case, in my application (a raytracer) I am reading in lists of >> numbers from a file representing the points of a mesh and the triangles >> that make up the mesh (represented by a list of indices into the mesh >> list). A dynamically resizable, reasonable scalable array seems like >> the best data structure to use. > > Why not use a list and then apply Array.of_list? I did try that. Then I ran up against the 4 MB limit. Which led to my original e-mail complaining about it here... :) Frederick Akalin