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

Creating/Maping rust types to Julia #78

Open
Roger-luo opened this issue Apr 6, 2023 · 1 comment
Open

Creating/Maping rust types to Julia #78

Roger-luo opened this issue Apr 6, 2023 · 1 comment

Comments

@Roger-luo
Copy link

in PyO3, one can map a rust type using PyObjectFrom to Julia, I'm wondering if there is something similar in this package to create a Julia object?

@Taaitaaiger
Copy link
Owner

Currently, the only way is to generate wrappers with JlrsReflect.jl. The generated wrappers derive all necessary traits to access data of that type from Rust.

The other way around is not yet possible, but will be soon. My main focus for the next version of jlrs has been the ability to export Rust types and functions in a way similar to CxxWrap. In particular, you will be able to implement the OpaqueType or ForeignType trait and use macros to export that type and its methods to Julia. This file is an example of a library that uses this feature to expose RustFFT to Julia. I have a working Yggdrasil recipe for this library locally, but haven't committed that yet.

That feature is very much geared towards creating libraries that can be distributed as JLLs, though, not embedding.

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