4 ms·
Does anyone know of an example of a rust library or function that’s been turned into a NIF? Ideally available on GitHub both before and after the conversion?
by algaeontoast 7y ago
Does anyone know of an example of a rust library or function that’s been turned into a NIF? Ideally available on GitHub both before and after the conversion?
Also, the “nerves” framework is basically 80% NIFS of embedded C code.
- elcritch 7y agoNerves overall has a much smaller portion of C nifs than 80%, probably < 10%. Mainly for properly trapping and cleaning up subprocesses. There’s some nifs too setup Linux specific sockets/ioctls. Still surprises me that almost every Linux kernel interface essentially overloads `ioctl`. Not sure of an example. Really just wrap any rust function with appropriate code to convert Erlang terms to rust and back... There’s a few elixir rustler howtos: https://medium.com/@jacob.lerche/writing-rust-nifs-for-your-elixir-code-with-the-rustler-package-d884a7c0dbe3 https://medium.com/@jacob.lerche/writing-rust-nifs-for-your-...
- lostjohnny 7y agoYou could check the list of packages depending on Rustler https://hex.pm/packages?search=depends%3Arustler https://hex.pm/packages?search=depends%3Arustler