Reference for Rust mechanism #464
-
Hello, I am trying to use the rustler library to write a niflib for Erlang. I am wondering if there exists some documentation or reference about the following topics:
thx a lot |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We don't have documentation on using Rustler from Erlang (yet). With regard to your questions:
I guess you mean the
Can you further explain what you mean? For a NIF, polymorphism is implemented by dynamic dispatch on the terms passed into the NIF. NIFs itself cannot be monomorphized, as C does not have that functionality.
This might be a large topic. Do you have a more specific question? |
Beta Was this translation helpful? Give feedback.
We don't have documentation on using Rustler from Erlang (yet). With regard to your questions:
I guess you mean the
crate-type
configuration? Our template (rustler_mix/priv/templates/basic/Cargo.toml.eex
) definescdylib
. If I remember correctly, we need to do this as cdylibs are used when compiling into a shared library to be used from C/C++.Can you further explain what you mean? For a NIF, polymorphism is implemented by dynamic dispatch on the terms passed into the NIF. NIFs itself cannot be monomorphized, as C does not have that functionality.
T…