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
64-bit OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-11-06 (10:06)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] 64-bit OCaml?
> I just obtained a new iMac G5 here. My cursory understanding is that this is
> a 64 bit core processor. However, when I attempted to run config for
> rebuilding the OCaml system, it reports a 32 bit system. What can or must I
> do to coax OCaml to become a 64 bit system for this processor?

As others have explained, the first thing you need is a 64-bit kernel
and a development environment (C compiler, linker, libraries) that
handles 64-bit code.  The next release of Mac OS X is rumored to offer
all this.

Once this is available, you should be able to compile the bytecoded
part of OCaml to 64-bit code using e.g. configure -cc "gcc -m64"
or whatever gcc options that select the generation of 64-bit apps.

However, ocamlopt will not work out of the box.  Some changes to the
asm code generator are required to produce 64-bit code.  In the case
of the PowerPC, the changes are relatively small.  Still, I can't
perform them until we have G5 machines at INRIA, which may take a while.
(Pretty much the only Apple hardware we buy are Powerbooks, and it's
unclear when G5 Powerbooks will be mainstream.)

Also, the only situations where 64-bit code is beneficial are 1- large
integer arithmetic (bignums, crypto), and 2- exploiting more than 4 Gb
of RAM.  In all other cases, 64-bit code is actually a waste,
since pointers occupy twice as much memory as with 32-bit code.

So, I expect 64-bit computing to take off when machines commonly have
4 Gb of RAM or more, which should take a few more years.  Caml will
have no problems adapting to this trend, since it's 64-bit clean from
the start.  (Caml Special Light, the ancestor of OCaml, was developed
circa 1995 on a 64-bit Alpha, then backported to 32-bit
architectures.)  I expect that at that time our "tier 1" architectures
will be x86-64 and PPC-64.

- Xavier Leroy