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

Add elixir bindings #535

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Add elixir bindings #535

wants to merge 8 commits into from

Conversation

BlazeWasHere
Copy link

@BlazeWasHere BlazeWasHere commented Feb 14, 2025

Adds elixir bindings through an Erlang NIF
Was using the python bindings as a reference FFI implementation, not sure if i am missing some things

also not sure if this even cross compiles (i hope :cc_precompiler works)

Still a WIP:

return make_error(env, ckzg_atoms.invalid_precompute_arg);

unsigned int len;
if (!enif_get_string_length(env, argv[0], &len, ERL_NIF_LATIN1))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that enif_get_string_length was only added since OTP 26.0 which was released in May 2023, not sure if we want to support older versions too?

@jtraglia
Copy link
Member

Hey @BlazeWasHere, this is cool! I would be happy to include this when it's ready. Out of curiosity, what will use these bindings? And another TODO item would be to add CI tests, see: https://github.com/ethereum/c-kzg-4844/tree/main/.github/workflows

@BlazeWasHere
Copy link
Author

@jtraglia no worries, one main user would be elixir_ethers via ExWeb3/elixir_ethers#178. also saw that lambdaclass used c-kzg-4844 in their elixir consensus client but used bindings from c -> rust -> elixir in kzg_nif (im assuming because there were no elixir bindings at the time)

@jtraglia
Copy link
Member

Okay nice. So this does have real value. Feel free to ping me if you have any questions.

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