# Does BitArraysX.jl or similar exist?

**URL:** <https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869>\
**Category:** Performance\
**Tags:** question, package\
**Created:** [December 15, 2024, 7:25pm UTC](https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869 "2024-12-15T19:25:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [December 15, 2024, 7:25pm UTC](https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869/1 "2024-12-15T19:25:49Z")

</div>

There have been a few posts over the years discussing constructing a `BitArray` from bits in an existing `Vector{<:Unsigned}`.

Does a package that does some version of this exist? I’ve cobbled something together for my own use.

I think most things you’d want to do could be handled in a package. For example, your incoming data may have opposite endianness.

One complication (but not a show stopper) that can’t be fixed in a package is the lack of a supporting inner constructor. This was mentioned in [an issue](https://github.com/JuliaLang/julia/issues/16542) in 2016, when making changes was easier.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 15, 2024, 7:59pm UTC](https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869/2 "2024-12-15T19:59:52Z")

</div>

> [@jlapeyre](#):
>
> One complication (but not a show stopper) that can’t be fixed in a package is the lack of a supporting inner constructor. This was mentioned in [an issue](https://github.com/JuliaLang/julia/issues/16542) in 2016, when making changes was easier.

Should still be possible to add a new constructor — adding new features is not breaking. A straightforward PR if someone wants to give it a shot.

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [December 15, 2024, 8:07pm UTC](https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869/3 "2024-12-15T20:07:46Z")

</div>

Yes, I don’t think adding a constructor breaks anything. I just meant you could be slightly more cavalier in 2016 about adding and removing features.
