-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support functions with >= 6 arguments #49
Comments
@mt-caret hello! Yes, you are correct, the current macro doesn't take into account bytecode functions (but you should be able to do the same thing that is done in C). But it is indeed reasonable to add support for this, I am just not sure about what it should look like (somehow, the bytecode name for the function needs to be provided in the macro, so that the wrapper function can be generated too). Did you have anything in particular in mind? |
I'm actually kind of a Rust noob so please correct me if I'm proposing something that's impossible, but I was thinking of just tacking on |
The symbol for the bytecode version name needs to be provided explicitly because with these macros new symbols cannot be introduced. Other than that it shouldn't be complicated. Let me think about it. |
I see, that makes sense. I was trying to manually work around this when I realized that ocaml-interop doesn't work as-is with bytecode compilation anyway due to #34 (I think?), so I guess even if we had something like this it won't be as useful as I originally thought. |
@mt-caret it can be worked around by enabling the See aebbdc5 and the related discussions:
It is all kinda dirty and not ideal, my hope is to be able to improve all this as part of the upgrade for supporting OCaml 5 (which requires improvements to how the runtime handle is implemented and also domain locks). |
Woah, this looks awesome! Thanks so much for the quick fix :) |
Just merged #50, closing this |
Awesome, tyvm! |
@mt-caret uff, the moment I published the new version I noticed I am generating the wrong code, I will fix it and publish it as v0.9.1 |
@mt-caret ok, just published v0.9.1 with the fixed expansion. |
AFAICT currently
ocaml_export
doesn't really know about restrictions around the number of arguments. It would be pretty nice ifocaml_export
notices that and generates the bytecode version of the function as well.I'm happy to take a crack at this and create a PR if you think this is a reasonable thing to add.
The text was updated successfully, but these errors were encountered: