Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
unsigned word type in OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-02-03 (12:05)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: unsigned word type in OCaml?
> I'm working on a low level systems project, and I'm thinking about using   
> OCaml as the langauge.  However, try as I might, I simply cannot find a   
> reference to a machine word type.
> More specially, I need:
> a. byte access to machine words
> b. unsigned 32 bit quantities (e.g. physical address)
> c. bitwise boolean operations (shifts, not, and & or)

None of this is supported natively in the language (OCaml's "int" type
and its associated operations is 31 or 63 bits, signed).

However, it's easy to define your "machine word" type as an abstract
type and implement it via small C functions.

Jean-Christophe Filliatre's "int32" library is a good starting point:


- Xavier Leroy