From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA08179 for caml-redistribution; Wed, 3 Feb 1999 13:05:08 +0100 (MET) 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 PAA10706 for ; Mon, 1 Feb 1999 15:11:00 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id PAA08469; Mon, 1 Feb 1999 15:10:48 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA22648; Mon, 1 Feb 1999 15:10:48 +0100 (MET) Message-ID: <19990201151047.52170@pauillac.inria.fr> Date: Mon, 1 Feb 1999 15:10:47 +0100 From: Xavier Leroy To: "Sussillo, David" , "'caml-list@inria.fr'" Subject: Re: unsigned word type in OCaml? References: <36B23B0D@smtp.ftintl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <36B23B0D@smtp.ftintl.com>; from Sussillo, David on Fri, Jan 29, 1999 at 02:23:00PM -0800 Sender: weis > 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: http://pauillac.inria.fr/caml/caml-list/0200.html http://www.ens-lyon.fr/~jcfillia/ftp/ocaml/int32 Regards, - Xavier Leroy