package ppx_bitstring

  1. Overview
  2. Docs
Bitstrings and bitstring matching for OCaml - PPX extension

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v5.0.2.tar.gz
md5=c05b0e2846eb0215c397c8e5befb0793
sha512=49834e427038bf8fe1cbd9bb4493429b10ea93f170080a317818c518d9cf0baf5e5a596b6e9b8e239c94127298a7e97e226544829b5b34a77231f43e460e95e2

Description

The ocaml-bitstring project adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml. You can use this module to both parse and generate binary formats, files and protocols. Bitstring handling is added as primitives to the language, making it exceptionally simple to use and very powerful.

Published: 05 Nov 2025

README

OCaml Bitstring Library

Build Status

Copyright (C) 2008-2016 Red Hat Inc, Richard W.M. Jones.
Copyright (C) 2016-2022 Red Hat Inc, Richard W.M. Jones, Xavier R. Guerin.

The original README content can be found in the README.orig file.

Documentation

The documentation is located here.

How to install

opam install bitstring
opam install ppx_bitstring

How to use

Ocamlfind

ocamlfind c -package bitstring -package ppx_bitstring -linkpkg ...

Dune

(executable
 ((name        foo)
  (libraries   (bitstring))
  (preprocess  (pps (ppx_bitstring)))
  ))

How to build

Dependencies

Required packages are detailed in the dune-project file.

Building the project

$ dune build

Running the tests

$ dune runtest

License

The library is licensed under the LGPL v2 or later, with the OCaml linking exception. See the file COPYING.LIB for full terms. Programs are licensed under the GPL v2 or later. See the file COPYING for full terms. All examples and tests are public domain.

Dependencies (4)

  1. ppxlib >= "0.36.0"
  2. bitstring >= "5.0.2"
  3. ocaml >= "5.2.0"
  4. dune >= "3.18"

Dev Dependencies (3)

  1. odoc with-doc
  2. ounit with-test
  3. ocaml with-test & >= "5.2.0"

Conflicts

None