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

Add first idea for rust api. #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

windelbouwman
Copy link

@windelbouwman windelbouwman commented Feb 17, 2021

Some ideas:

  • change the rust crate into a library with some usage examples.
  • Have two layers:
    1. C function prototypes
    2. A rustic api
  • We might want to use bindgen?

@rossant
Copy link
Contributor

rossant commented Feb 17, 2021

Nice, thanks! a few notes:

  • Having 2 layers seems like a good idea
  • I would indeed suggest to use an automatic binding generator since the API is still changing a lot
  • As you probably saw in the code, my approach so far with the Cython bindings has been to write a quick and dirty homemade binding generator: a Python script that parses the headers and generates the Cython bindings of the C functions. On top of that I manually write and maintain a second layer with a light Pythonic object-oriented interface. So, very similar to what you propose.
  • It might make sense to coordinate so that the Pythonic/rustic/etc interfaces match as much as possible
  • Note that I have 0 experience with Rust and I am therefore not familiar with best practices in this language

@rossant rossant added the rust label Feb 18, 2021
@rossant rossant mentioned this pull request May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants