From: Mike Hamburg <hamburg@fas.harvard.edu>
To: Christophe Raffalli <christophe.raffalli@univ-savoie.fr>
Cc: caml-list@inria.fr, Charles Martin <chaspost@yahoo.com>
Subject: Re: [Caml-list] unboxing options
Date: Wed, 11 May 2005 13:18:57 -0400 [thread overview]
Message-ID: <e72c14e4f63227fe1c7f448c9761ec5c@fas.harvard.edu> (raw)
In-Reply-To: <4280FB1F.3050003@univ-savoie.fr>
Why should we need an "unboxed" keyword? Is there any reason why the
user should want things to be boxed? (Perhaps for interfacing with C?)
It seems to me that since a pure OCaml program would just be
specifying unboxed everywhere it could, the compiler could try to just
unbox everything it can. Assuming, that is, that changing the float
unboxing code to unbox other stuff is actually fairly easy.
Mike
On May 10, 2005, at 2:19 PM, Christophe Raffalli wrote:
>
>> 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
> ---------------------------------------------
next prev parent reply other threads:[~2005-05-11 17:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-06 3:22 Charles Martin
2005-05-10 18:19 ` [Caml-list] " Christophe Raffalli
2005-05-11 17:18 ` Mike Hamburg [this message]
2005-05-11 18:50 ` Christophe Raffalli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e72c14e4f63227fe1c7f448c9761ec5c@fas.harvard.edu \
--to=hamburg@fas.harvard.edu \
--cc=caml-list@inria.fr \
--cc=chaspost@yahoo.com \
--cc=christophe.raffalli@univ-savoie.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox