Error: unix_inet_addr_of_string not implemented by BuckleScript yet


#1

I’m very new in ReasonML and BuckleScript and also OCaml.

When I run a script which contains

require('bs-platform/lib/js/unix.js')

The runtime emits Error: unix_inet_addr_of_string not implemented by BuckleScript yet while the ReasonML and BuckleScript API docs are mentioning that there is a standard OCaml library which also has Unix module without any notes.

What is the current status of the Unix module from BuckleScript? Do you use Node module instead in general?


#2

Same with me. I get this error when trying to use anything from Unix API.


#3

Hi, some OCaml modules are not implemented by BuckleScript due to platform differences (native vs JavaScript). Most of the differences are listed in this page: https://bucklescript.github.io/docs/en/difference-from-native-ocaml

But it looks like the Unix difference was missed, it will need to be added in.

If you’re targeting Node, then you would use the normal equivalent Node APIs.


#4

Thanks for clarification! Yes, I ended up declaring external reference to Node function.