Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Primitive sizes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Primitive sizes
On Thu, Sep 30, 2004 at 03:54:33PM -0500, Brian Hurt wrote:
> I don't know what Java's calling convention is.  My advice:
> 
> >  Type     Bits
> >  -----    ----
> > byte    - 8
> > short   - 16
> > char    - 16
> > boolean - 8
> 
> The above I'd just promote to ints for Ocaml, and truncate as necessary.

We have a similar problem with the ocamldbi Dbi interface.  It maps
SQL int4 and serial types (ie. full 32 bit signed ints) to OCaml int.

The reason is convenience.  It's MUCH more convenient to deal with
OCaml int than boxed Int32.

However if anyone has a database with more than about 1 billion rows
in it, then they may find they have a problem ...

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
"One serious obstacle to the adoption of good programming languages is
the notion that everything has to be sacrificed for speed. In computer
languages as in life, speed kills." -- Mike Vanier