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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 3BE3AD55E for ; Wed, 27 Jul 2005 22:11:43 +0200 (CEST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6RKBfso004589 for ; Wed, 27 Jul 2005 22:11:42 +0200 Received: from rosella (ppp41-136.lns2.syd6.internode.on.net [59.167.41.136]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j6RKBboH061122; Thu, 28 Jul 2005 05:41:37 +0930 (CST) Subject: Re: [Caml-list] How to do this properly with OCaml? From: skaller To: David Thomas Cc: caml-list@yquem.inria.fr In-Reply-To: <20050727153558.80900.qmail@web30515.mail.mud.yahoo.com> References: <20050727153558.80900.qmail@web30515.mail.mud.yahoo.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-t+0iNEdiQbGwepJrisIO" Date: Thu, 28 Jul 2005 06:11:38 +1000 Message-Id: <1122495098.6768.283.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 X-Miltered: at concorde with ID 42E7EA7D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 arrays:01 ocaml:01 heap:01 pointer:01 pointer:01 pointers:01 arrays:01 unboxed:01 compiler:01 indirection:01 ...:98 wrote:01 sourceforge:01 X-Attachments: type="application/pgp-signature" name="signature.asc" 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 --=-t+0iNEdiQbGwepJrisIO Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2005-07-27 at 08:35 -0700, David Thomas wrote: > I'm still curious what numerical algorithm is so > desperately in need of variable length arrays... I think I was not clear. Normally Ocaml boxes contain either an int or a heap pointer to a data object. So a floating point value is represented by a pointer. Doing numerical programming with an array of pointers to floats instead of an array of floats has a performance impact, so Ocaml now provides arrays of unboxed floats. I wasn't referring to the need for variable length arrays in numerical code, but the need to circumvent boxing in numerical code for arrays of numerical values: this is considered significant enough to warrant specialised compiler optimisations and data structures. The point being, arrays of boxes are considered inefficient, and in some cases it is already considered significant enough for considerable work to be done to fix it. So arguing an extra indirection required for the array of option solution to variable length arrays is insignificant is contrary to the evidence that INRIA already accepts it can be inefficient. Again, this is not to say variable length arrays without this extra overhead should be provided, just that the argument that the overhead is not significant is suspect. --=20 John Skaller --=-t+0iNEdiQbGwepJrisIO Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBC5+p4sRp8/9aGVGsRAu+bAKCEyrPexTrM1YRs/eadGT27WNIyIACdElDw WRqe+9BNanm7zaxaQKE3uX0= =Dmrn -----END PGP SIGNATURE----- --=-t+0iNEdiQbGwepJrisIO--