capnproto / capnp-ocaml

OCaml code generator plugin for the Cap'n Proto serialization framework
Other
96 stars 20 forks source link

js_of_ocaml support #76

Open zenhack opened 3 years ago

zenhack commented 3 years ago

It would be really nice to be able to use this in the browser. Right now this doesn't build with js_of_ocaml, because of at least the dependency on stdint, though I'm not sure if there's anything else?

If stdint is the only thing, then maybe this just reduces to https://github.com/andrenth/ocaml-stdint/issues/6, but I wanted to ask, lest I discover after putting in some work that it's a much bigger task.

(I'm also interested in getting the rpc layer working in the browser)

talex5 commented 3 years ago

It probably is just that. I've had capnp-rpc running in a Mirage unikernel before, and I just had to hack uint (the predecessor to stdint) to make that work.

I think I just defined type uint64 = int64 as a hack to get it going. That's not quite right (comparisons between uint64s may give the wrong answer, although capnp itself doesn't care), but it might let you know if anything else is wrong.