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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 0F7D6BC37 for ; Sun, 8 Nov 2009 20:39:15 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQBAKus9krYi40EmWdsb2JhbACBTYMklwUBAQEBAQgLCgcTrVePKoNqVAQ X-IronPort-AV: E=Sophos;i="4.44,704,1249250400"; d="scan'208";a="49995348" Received: from mail-out4.nyct.net (HELO mail.nyct.net) ([216.139.141.4]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Nov 2009 20:39:14 +0100 Received: from sergyar.local (pool-96-246-12-3.nycmny.east.verizon.net [96.246.12.3]) (authenticated bits=0) by mail.nyct.net (8.14.3/8.14.1) with ESMTP id nA8JdE1T071812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Nov 2009 14:39:16 -0500 (EST) (envelope-from bhurt@spnz.org) Date: Sun, 8 Nov 2009 14:39:03 -0500 (EST) From: Brian Hurt X-X-Sender: bhurt@sergyar To: =?ISO-8859-15?Q?Daniel_B=FCnzli?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unboxed float tuples In-Reply-To: <91a3da520911080801w6637b652w94a717a830b1c5bd@mail.gmail.com> Message-ID: References: <91a3da520911080801w6637b652w94a717a830b1c5bd@mail.gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1159638741-1257709151=:31905" X-Spam: no; 0.00; unboxed:01 unreadable:01 mime-aware:01 unboxed:01 arrays:01 compiler:01 compiler:01 bindings:01 garbage:01 wrote:01 rewrite:01 readable:01 compile:01 caml-list:01 tuples:01 X-Attachments: cset="UTF-8" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1159638741-1257709151=:31905 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 9 Nov 2009, Daniel Bünzli wrote: > Tuples and records are represented the same way. However when it comes > to records with only floats fields we get a special unboxed > representation. > > Why don't we get that for tuples of floats only ? Because tuples are generic data types. Access to records and arrays are special cased- in the record case, because the compiler knows the type of the record, in the array case because array access is via C code which handles the special case. But the compiler needs to be able to compile code with generic tuple accesses, like: let third_of_four (_, _, x, _) -> x;; Fixing this would require a major rearchitecting and rewrite of not only the compiler, but also the garbage collector, the run time, and all the C bindings that have been written. Brian --8323329-1159638741-1257709151=:31905--