Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIF Inspection Tool #614

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

NIF Inspection Tool #614

wants to merge 3 commits into from

Conversation

filmor
Copy link
Member

@filmor filmor commented May 29, 2024

Initial PoC for a tool that takes a compiled NIF library and reads back its information. This could be used to automatically generate a matching Erlang (rebar3_cargo) or Elixir (Rustler) module. Could be a dead end, but I don't like the current ergonomics of the wrapper modules.

@hansihe
Copy link
Member

hansihe commented Jun 6, 2024

An alternate approach here might be to serialize the configuration and embed it in the binary as a symbol. We could then just read it directly from the binary, without having to load it.

I think this would have a few advantages:

  • Reading out the config could be fully platform independent
  • It would not require us to actually load the library to get the config
  • We don't need a native tool, and we don't need to provide all symbols the NIFs require

@filmor
Copy link
Member Author

filmor commented Jun 6, 2024

Any example of what you are thinking of? With the NIF discovery merged, the NIF collection will only be known when loading the library (which is how NIF linraries work on general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants