From: Nicolas C. <war...@fr...> - 2004-03-20 10:23:48
|
> > 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? GMP is C, ExtLib is OCaml If you want to provide a 3rd party library having very efficient bitsets and big ints based on GMP, then I think it's nice idea. But since we agreed in the beginning that ExtLib will not have C parts (since with that comes a lot of compability, compilation, and installation problems) then I can't see that being put into ExtLib. Current bitsets are useful and enough efficient for the average user. Regards, Nicolas Cannasse |