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

Exposing functions/classes from Java (using a WASM runtime) to RustPython #3985

Closed
Yu-Vitaqua-fer-Chronos opened this issue Jul 29, 2022 · 3 comments

Comments

@Yu-Vitaqua-fer-Chronos
Copy link

Heya, the title says it all haha, I'm interested in trying to embed RustPython into my Java application, and I want to use it as a scripting language, but I don't know how I'd expose a function to it at all really, is there anything specific I'd need to do? Any advice to use this within Java too? GraalVM would be ideal but as that isn't an option for me, I'd like to look at other ways of doing this

@youknowone
Copy link
Member

wow, interesting challenge.

This is including 3 separated parts.

  1. exporting java symbol to wasm side. I think you will handle this well.
  2. importing wasm symbol to rust. I don't know well about wasm, but wasm_bindgen is the part rust recognize wasm symbols in rust.
  3. RustPython recognize wasm symbols as Python function. I think this is manually approachable like wasm/lib/src/js_module.rs, but not sure how to do exactly.

@coolreader18 any advice?

@Yu-Vitaqua-fer-Chronos
Copy link
Author

  1. exporting java symbol to wasm side. I think you will handle this well.

I've actually seen a few projects such as "New Moon With Report" that give this functionality, I just don't know if it'll run with RustPython haha, something to test when i can

@Yu-Vitaqua-fer-Chronos
Copy link
Author

Created a discussion for this instead: #3997

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

No branches or pull requests

2 participants