Giter VIP home page Giter VIP logo

bitv's People

Contributors

backtracking avatar damiendoligez avatar favonia avatar pascutto avatar tbrk avatar unixjunkie avatar vbmithr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitv's Issues

Deprecate Bitv in favor of Zarith

What are the reasons to prefer bitv to zarith?

The following functions are missing but could be easily added:

  • sub -> extract
  • fill
  • blit
  • setbit, clearbit or set

I would like to introduce get_bits

So that users can access the underlying array, and, for example,
use hardware accelerated popcount on the whole bitstring
when performance requires it.

Would you be OK with such a pull request?

Incorrect documentation of the length of the machine-independent format?

I believe the following documentation for the machine-independent format is incorrect:

bitv/bitv.mli

Lines 204 to 206 in 531844c

For a bit vector of length [n], the number of bytes of this external
representation is 4+ceil(n/8) on a 32-bit machine and 8+ceil(n/8) on
a 64-bit machine. *)

The reason is that the code seems to fix the number of bytes to 8. If so, the length is always 8+ceil(n/8).

bitv/bitv.ml

Lines 582 to 583 in 531844c

let bytes_of_int x =
Bytes.init 8 (fun i -> Char.chr ((x lsr (8 * i)) land 0xFF))

I wonder if I missed anything?

What is the correct way to buffer bits ?

Is there something like the stdlib's Buffer module to accumulate many bits
before finally storing them on disk ?
Later, I'd like to read them back in of course.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.