From: Brian H. <bh...@sp...> - 2004-03-19 18:49:01
|
On Fri, 19 Mar 2004, Nicolas Cannasse wrote: > Concerning the usage of int, OCaml runtime representation is 31 bits. They > are unboxed and shifted by 1 and the lowest bit is set to 1 so it can't be > mistaken with an address since all addresses are always aligned on 2 bytes > (even 4 on most of 32-bits architectures) . So we could use ints as 31 bits > but we would then need to div/mod to get the correct integer. Another nice > thing about strings is that their contents are not scanned by the GC while > Array of ints are. > Having looked at implementing bitset myself, I came to the following conclusions: 1) bitset and big int support should be combined, much like an int can be viewed both as a small integer and as a small bitset, depending. 2) Both should be built on top of gmp. 3) GMP doesn't do everything I want bitset to be able to do yet. Most everything, but not everything (bitblit doesn't exist). 4) I'm on-again off-again trying to get gmp to accept patches to let it do what I want it to, but I'm getting push-back. I'm tempted to just provide the wrappers for the existing gmp functionality, and support the rest when it shows up. Thoughts? -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian |