# Error: Bigstringaf\_blit\_from\_bytes not implemented

**URL:** <https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618>\
**Category:** Learning\
**Tags:** build, dune\
**Created:** [May 7, 2025, 12:40pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618 "2025-05-07T12:40:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Null.Pointer-Except](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/null.pointer-except/32/5969_2.png) [@Null.Pointer-Except](https://discuss.ocaml.org/u/Null.Pointer-Except)\
**Post date:** [May 7, 2025, 12:40pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/1 "2025-05-07T12:40:16Z")

</div>

I’m experiencing similar issues to that of [this post](https://discuss.ocaml.org/t/bigstringaf-blit-from-bytes-not-implemented/6524) while building my dune project that depends on the angstrom library.

```auto
node ./_build/default/bin/main.bc.wasm.js
/home/dan/Enzo/ZillyO/_build/default/bin/main.bc.wasm.js:450
          throw: e=>{throw e;},
                     ^

Error: bigstringaf_blit_from_bytes not implemented

```

Nevertheless, the post don’t seem to say what was the issue or how it was fixed. I’m pretty new to ocaml, so I’m not sure if the answer was just that simple.

This is my dune file for the bin:

```auto
(executable
 (name main)
 (libraries
   js_of_ocaml
   bigstringaf
   ZillyO)
 (modes wasm))
(install
   (section bin)
   (files (main.bc.wasm.js as ZillyO)))

```

I also list `bigstringaf` as a dependency in my `dune-project` file:

```auto
(depends ocaml angstrom bigstringaf)

```

Anybody knows a workaround this?

---

<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:** [May 7, 2025, 12:54pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/2 "2025-05-07T12:54:34Z")

</div>

It seems bigstringaf has C primitives. These primitives are implemented for [C](https://github.com/inhabitedtype/bigstringaf/blob/master/lib/bigstringaf_stubs.c) and [JavaScript](https://github.com/inhabitedtype/bigstringaf/blob/master/lib/runtime.js). I suspect the story on how this should be done for WASM hasn’t been written so far (at least nothing [here](https://ocsigen.org/js_of_ocaml/latest/manual/runtime-files)).

> [@Null.Pointer-Except](#):
>
> Anybody knows a workaround this?

```auto
(modes js)

```

I suspect.

---

<div class="post-metadata">

**Author:** ![jmid](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jmid](https://discuss.ocaml.org/u/jmid)\
**Post date:** [May 7, 2025, 2:08pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/3 "2025-05-07T14:08:59Z")

</div>

> Anybody knows a workaround this?

I can see @vouillon opened a PR back in December:

> <https://github.com/inhabitedtype/bigstringaf/pull/57>

Have you tried pinning that branch of `bigstringaf`? 🤔

---

<div class="post-metadata">

**Author:** ![Null.Pointer-Except](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/null.pointer-except/32/5969_2.png) [@Null.Pointer-Except](https://discuss.ocaml.org/u/Null.Pointer-Except)\
**Post date:** [May 7, 2025, 3:06pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/4 "2025-05-07T15:06:19Z")

</div>

ohh, this might work? sadly i have no idea how to do that, less in my nix flake which uses `pkgs.ocamlPackages.angstrom` instead of opam x.x

---

<div class="post-metadata">

**Author:** ![Null.Pointer-Except](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/null.pointer-except/32/5969_2.png) [@Null.Pointer-Except](https://discuss.ocaml.org/u/Null.Pointer-Except)\
**Post date:** [May 7, 2025, 3:15pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/5 "2025-05-07T15:15:18Z")

</div>

oh yes, on `(modes js)` it works fine, sadly i also need for it to work on `(modes wasm)`

---

<div class="post-metadata">

**Author:** ![otini](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/otini/32/3533_2.png) [@otini](https://discuss.ocaml.org/u/otini)\
**Post date:** [May 7, 2025, 3:17pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/6 "2025-05-07T15:17:01Z")

</div>

It should suffice to override the src and digest of the `bigstringaf` package, but I don’t know the exact occult incantation to do this in a flake.

---

<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:** [May 7, 2025, 7:39pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/7 "2025-05-07T19:39:40Z")

</div>

Is there any documentation about how to support primitives in wasm ?

---

<div class="post-metadata">

**Author:** ![vouillon](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/vouillon/32/2028_2.png) [@vouillon](https://discuss.ocaml.org/u/vouillon)\
**Post date:** [May 7, 2025, 7:46pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/8 "2025-05-07T19:46:18Z")

</div>

There is this: [Writing Wasm primitives](https://ocsigen.org/js_of_ocaml/dev/manual/wasm_runtime).

---

<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:** [May 7, 2025, 7:54pm UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/9 "2025-05-07T19:54:11Z")

</div>

Ah nice you have to guess the link :–) ? I think it would be nice to switch to `.mld` files at somepoint this ocsigen website remains totally unusable and unreadable.

So what is the `ocamlfind` story here ?

---

<div class="post-metadata">

**Author:** ![otini](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/otini/32/3533_2.png) [@otini](https://discuss.ocaml.org/u/otini)\
**Post date:** [May 8, 2025, 1:15am UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/10 "2025-05-08T01:15:03Z")

</div>

> [@dbuenzli](#):
>
> Ah nice you have to guess the link :–) ? I think it would be nice to switch to `.mld` files at somepoint this ocsigen website remains totally unusable and unreadable.

Thanks for the opinion; it strikes me as unnecessarily sarcastic and blunt but I’ll be sure to reflect on it anyway. The link in the side menu, we clarified the section name in a recent PR which should be up soon.

---

<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:** [May 8, 2025, 7:31am UTC](https://discuss.ocaml.org/t/error-bigstringaf-blit-from-bytes-not-implemented/16618/11 "2025-05-08T07:31:14Z")

</div>

> [@otini](#):
>
> it strikes me as unnecessarily sarcastic

It’s not sarcastic, it’s a reality.

If you want to further reflect: I think that use of `js_of_ocaml` in general has been hindered by a terrible lack of documentation and usability thinking in every dimension of the project which is a shame given the excellent compiler (and here is [my contribution](https://erratique.ch/software/brr/doc/) to try to alleviate that).
