-
Notifications
You must be signed in to change notification settings - Fork 228
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 Codegen rework #264
NIF Codegen rework #264
Conversation
a20cdd6
to
9396c0b
Compare
I am not sure if I understand this correctly, but I think my comment here might cover this. |
@scrogson I really like this PR, great work! :) |
@evnu, thank you. This has been on my mind for quite a long time. It feels great to finally get it working. Thanks for your review! |
d49aa9d
to
529f505
Compare
When looking into the failures with the
Running extern "C" fn nif_load(
env: rustler::codegen_runtime::NIF_ENV,
_priv_data: *mut *mut rustler::codegen_runtime::c_void,
load_info: rustler::codegen_runtime::NIF_TERM,
) -> rustler::codegen_runtime::c_int {
unsafe {
(/*ERROR*/)
}
} @evnu do you have any ideas how to fix that? |
On mobile, so only a first question: originally, a NIf entry was of the form(erlang Name, rust function, optional flags), and right now we are missing the option to pass in the flags, right? |
@evnu the way I wrote the parser, I thought this would be covered (but apparently it isn't): https://github.com/rusterlium/rustler/pull/264/files#diff-8daf9e0986d966ebc2c4878e8a772b5fR20-R25 |
I'll have a look at the code tomorrow, but one more suggestion: Now that this is an actual
This opens up the possibility of adding more parameters in the future (e.g. I'd really like to be able to allow a |
Yeah, I like that. I'll work on that tonight. |
See https://github.com/rusterlium/rustler/pull/264/files#r341824704 We need to encode |
@scrogson see evnu@1794b33 for an idea on how to fix the problem with |
529f505
to
0cc2c34
Compare
Signed-off-by: Sonny Scroggin <[email protected]>
0cc2c34
to
a1cf8a2
Compare
9af9453
to
3e9e6fc
Compare
3e9e6fc
to
eaf72ca
Compare
I've got the new macros all working! 🎉
I'm pretty excited about this, but I'm pretty sure there are some opportunities for some clean up.
One thing I've noticed is that if you specify any term which is hasdecode
called on it, that function needs to return aResult<T, E>
. It would be nice to avoid this if possible.Let me know what you think.