# \[ANN\] Bytesrw 0.1.0 – Composable byte stream readers and writers

**URL:** <https://discuss.ocaml.org/t/ann-bytesrw-0-1-0-composable-byte-stream-readers-and-writers/15696>\
**Category:** Community\
**Tags:** ocsf, io, effects, concurrency, announce\
**Created:** [November 28, 2024, 5:08pm UTC](https://discuss.ocaml.org/t/ann-bytesrw-0-1-0-composable-byte-stream-readers-and-writers/15696 "2024-11-28T17:08:21Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [November 28, 2024, 5:08pm UTC](https://discuss.ocaml.org/t/ann-bytesrw-0-1-0-composable-byte-stream-readers-and-writers/15696/1 "2024-11-28T17:08:21Z")

</div>

Hello,

It’s my pleasure to announce the first release of the `bytesrw` library:

> Bytesrw extends the OCaml `Bytes` module with composable, memory efficient, byte stream readers and writers compatible with effect-based concurrency.
> 
> Except for byte slice life-times, these abstractions intentionally separate away ressource management and the specifics of reading and writing bytes.
> 
> Bytesrw distributed under the ISC license. It has no dependencies.
> 
> Optional support for compressed and hashed bytes depend, at your wish, on the C [`zlib`](https://zlib.net), [`libzstd`](http://zstd.net), [`blake3`](https://blake3.io), [`libmd`](https://www.hadrons.org/software/libmd/), [`xxhash`](https://xxhash.com/) and libraries.

The only reason I was longing for OCaml algebraic effects was so that I could avoid using them: when you write codecs on byte streams it should not be a concern where your bytes are coming from or headed to. The `bytesrw` library provides structures to abstract this. Additionally it establishes a buffer ownership discipline that enables byte streams to (de)compose while remaining memory efficient.

I do not expect the library to change much and it has been used. But it’s new and practice may call for adjustments. Do not hesitate to get in touch if you run into problems or see obvious defects or improvements. I do expect the library will add more convenience (e.g. for processing lines and UTF) and more optional stream formats over time.

Homepage: [https://erratique.ch/software/bytesrw](https://erratique.ch/software/bytesrw)  
Docs: [https://erratique.ch/software/bytesrw/doc](https://erratique.ch/software/bytesrw/doc) or `odig doc bytesrw`  
Install: `opam install bytesrw conf-zlib conf-zstd conf-libblake3 conf-libmd conf-xxhash` ([opam PR](https://github.com/ocaml/opam-repository/pull/26990))

This first release was made possible thanks to a grant from the [OCaml Software Foundation](https://ocaml-sf.org/). I also thank my [donors](https://github.com/sponsors/dbuenzli) for their support.

Best,

Daniel

---

_[View the full topic](https://discuss.ocaml.org/t/ann-bytesrw-0-1-0-composable-byte-stream-readers-and-writers/15696)._
