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

Rust Support #69

Open
meawoppl opened this issue Dec 1, 2024 · 4 comments
Open

Rust Support #69

meawoppl opened this issue Dec 1, 2024 · 4 comments

Comments

@meawoppl
Copy link

meawoppl commented Dec 1, 2024

Hey all,

Great library. I have implemented a nearly complete Rust wrapper for the C api, and I was curious if you all had any interest in hosting it here. In some fashion. I only have one device to test against, so my coverage is likely woefully low in some senses.
Do you all have some form of HIL testing you do to keep this library working?

In parallel, I have discovered a large number of (small) docs issues that I will contribute in either case. Let me know on the above, and thanks again for maintaining this.

@drebbe-intrepid
Copy link
Collaborator

drebbe-intrepid commented Dec 3, 2024

@meawoppl This is great news! I would love to see it and more details on it.

I'm in process of refactoring the C API to make it easier to maintain going forward and easily support other languages in the process. https://github.com/intrepidcs/libicsneo/blob/icsneo_api/include/icsneo/icsneo.h. My ultimate end goal was to create an API that would "just work" with C#, rust, zig, and go by "importing" the header.

@meawoppl
Copy link
Author

meawoppl commented Dec 9, 2024

Lovely...is there a way to use a .so with these calls instead? I don't see it in the build artifacts at time of writing.

@drebbe-intrepid
Copy link
Collaborator

drebbe-intrepid commented Dec 10, 2024

@meawoppl in your cmake build directory if you are using icsneo_api branch you'll have a libicsneo.so and libicsneo-static.a generated. The name is still pending and there are things that are broken.

I did a simple test against this branch with bindgen and it seemed to generate correct bindings so far. I'm about 80% done with creating the APIs.

@drebbe-intrepid
Copy link
Collaborator

@meawoppl I've completed a basic proof of concept for this new API and have a "functional" test cargo project here: https://github.com/intrepidcs/libicsneo/blob/icsneo_api/bindings/rust/icsneors/src/lib.rs

This is only binding generation and all unsafe currently. The "safe" layer still needs to be done and we are open to any feedback or recommendations including the work you have already done if you'd like to share it.

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