From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 6E19EBCAB for ; Tue, 10 May 2005 20:19:14 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4AIJDxc007905 for ; Tue, 10 May 2005 20:19:14 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA08799 for ; Tue, 10 May 2005 20:19:13 +0200 (MET DST) Received: from smtp.cegetel.net (mf00.sitadelle.com [212.94.174.79]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4AIJDEl007902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 10 May 2005 20:19:13 +0200 Received: from [192.168.144.2] (80-125-226-141.dti.cegetel.net [80.125.226.141]) by smtp.cegetel.net (Postfix) with ESMTP id 943B01A43AE; Tue, 10 May 2005 20:18:57 +0200 (CEST) Message-ID: <4280FB1F.3050003@univ-savoie.fr> Date: Tue, 10 May 2005 20:19:11 +0200 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050322 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Charles Martin Cc: caml-list@inria.fr Subject: Re: [Caml-list] unboxing options References: <20050506032256.10948.qmail@web90105.mail.scd.yahoo.com> In-Reply-To: <20050506032256.10948.qmail@web90105.mail.scd.yahoo.com> X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB09A242D970D4D7AED74EC6D" Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 4280FB21.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4280FB21.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 caml-list:01 unboxing:01 foo:01 mutable:01 foo:01 mutable:01 unboxed:01 compiler:01 unboxed:01 chablais:01 X-Attachments: type="application/pgp-signature" name="signature.asc" name="signature.asc" X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB09A242D970D4D7AED74EC6D Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit > type 'a foo = { one : 'a option; mutable two : 'a > option } > > would become: > > type 'a foo = { optional one : 'a; optional > mutable two : 'a } > You could also unbox any data type whose size is know at compile time in a record if an "unboxed" keyword is present ... and remove the nasty bit of the compiler handling float in record. { unboxed float x; unboxed muatable float y } You could imagine doing the same for array with a type ('a, 'b) array where 'a is the type of the content and 'b is either `Boxed or `Unboxed (using polymorphic variant) but you still need a test for polymorphic function on array which need to know if the array is unboxed and if yes what is the size of each array cell. I guess the code for this is not much more complex that the actual code for float optimization, and is more general. -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- --------------enigB09A242D970D4D7AED74EC6D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFCgPsfSQDyWB/+xBwRAmPsAKCkXw3eejzrDzXPP8lQl10KZCB4xQCgyVmJ 7EeISGTZUSWhQEps1/8OkCA= =LUIH -----END PGP SIGNATURE----- --------------enigB09A242D970D4D7AED74EC6D--