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 Ruby file loading, class extraction and method call #70
Comments
Surely! My reasoning for now was that anyone would use Ruby's reflection API and call it dybamically either with But of course, for added elegance and performance, some wrappers would be nice. Did you take a short look over the API? Is there any particular way you see this implemented? I'm guessing that you need a few functions defined on the mruby instance. |
The example shouldn't be so hard to implement. What you would need would be some module handling functions (like |
I was thinking a while ago about adding a |
I've looked into it a bit more and I came to the conclusion that we need a class structure:
The following methods need to be added:
I don't think we should make any distinction in Rust between modules and classes, since they can be swapped safely as far as I know. Let me know if you want to try a PR with this. If not, I'll try to implement it during the following days. |
Thanks for your quick and detailed answer! I'll start the implementation right now, but I don't have any mruby experience so I might ask questions :) |
Most of the stuff shouldn't be so hard. You can find most of the relevant
The rest should be pretty easy and similar to what is already implemented. If you need anything else, I usually answer pretty fast. |
@ihrwein Did you encounter any issues? If you need an implementation for this soon, I can try finishing it. |
Sorry for my late response. I managed to implement I saw that you began to work on this feature. I still want to use mruby for one of my pet projects so I'll use the new functionality, just cannot make it myself. Thanks for your work! |
First of all, thanks for this library! I was stunned by the elegancy of your crate :)
I'm in a great need of an embedded language in a Rust project. I wanted to use Python, then I read
your post in reddit and I got here.
I need to load a pure Ruby module with a class, create an instance from the class (with parameters), then call a method on the instance several times. I found an interesting wiki page which shows the steps
what I want to accomplish (just in C). I didn't find Rust bindings for some methods (e.g.
mrb_class_get_under
). Do you want to support this use-case?Thanks!
The text was updated successfully, but these errors were encountered: