Bigstringaf_blit_from_bytes not implemented

I’m trying to use something that in jsoo that uses angstrom parser but getting the following error. Looking through the trail of PRs it seems like work has been put into support bigstringaf on JSOO.

Anyone know what the situation is?

1 Like

You probably should make an issue here where bigstringaf_blit_from_bytes is a C function provided by the bigstringaf package (used by angstrom). As far as I can tell, a JSOO bindings exists but it seems that the binding does not appear for js_of_ocaml.

I’m not really aware about the js_of_ocaml compilation but it should be easy to fix I believe.

1 Like

Then, with bigstringaf.0.6.1, it seems that the bug does not appear with:

let str = "Hello World!"
let () =
  let v = Bigstringaf.of_string ~off:0 ~len:(String.length str) str in
  print_endline (Bigstringaf.to_string str)

And this dune file:

(executable
 (name main)
 (modes js)
 (libraries bigstringaf))

You can compile it with dune build main.bc.js and the JS file has (as expected) bigstringaf_blit_from_bytes.

1 Like

Whoo, I figured it out. Thanks @dinosaure. The issue is on my side, so it’s good all works. For various reasons, I’m not using dune, and so I was not including the runtime.

Tangential question: I see some jsoo values in the bigstringaf META file, is there any way to use ocamlfind to access those? Do they exist just for dune to parse?

Ah, I see I can do what I want with ocamlfind query.

ocamlfind query -r -predicates "javascript" -format "%(linkopts)" uri