Skip to content
Discussion options

You must be logged in to vote

We don't have documentation on using Rustler from Erlang (yet). With regard to your questions:

  • the lib attributes used in Cargo manifest

I guess you mean the crate-type configuration? Our template (rustler_mix/priv/templates/basic/Cargo.toml.eex ) defines cdylib. 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++.

  • parametric polymorphic functions

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.

  • how lifetime and ownership, borrow checker work in nif

T…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alissa-tung
Comment options

Answer selected by alissa-tung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #450 on June 11, 2022 13:13.