English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Int32 and boxing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-15 (06:59)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Int32 and boxing
On Monday 13 August 2007 18:55:01 Richard Jones wrote:
> I deal a lot with int32 and int64 types when interfacing with other
> languages, so this causes an annoyance.  I'm not sure what the
> implications would be of having a different representation on 32 and
> 64 bit machines.  I guess Marshal would have to go through hoops for a
> start.

Now that I think about it in more detail, this would probably require deeper 
compiler changes than I had thought. You wouldn't need to alter the run-time 
but you'd need to emit different load and store code for unboxed float32s, 
tagging and untagging them, and do arithmetic in 32-bit registers.

I'm not sure Marshal would need changing though. The representation would be 
embedded in nativeint so it would just be a type difference.

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists