FFIG / ffig

Generate code to call C++ libraries from other languages
MIT License
29 stars 9 forks source link

Generate Rust bindings #91

Open jbcoe opened 7 years ago

jbcoe commented 7 years ago

Add a template to ffig/templates and modify cmake/ffig.cmake so that Rust bindings can be generated.

petr-tik commented 7 years ago

that will get us to the top of hackernews!!111

jbcoe commented 7 years ago

@petr-tik are you tempted to try this?

petr-tik commented 7 years ago

Sorry, that was a sarky comment - I don't know enough rust to even take a stab and I want to concentrate on documenting the code and getting a web version out asap

I know someone, who might be though.

jbcoe commented 7 years ago

@petr I found that writing the template was a fun way to learn ruby. I Should probably raise a ticket to improve the ruby bindings.

petr-tik commented 7 years ago

ok, let's discuss this tonight

petr-tik commented 7 years ago

As discussed, I will pick this up, but it will take me a while (not the priority atm imho) and it's likely to be very basic

jbcoe commented 7 years ago

Maybe useful:

I'll happily merge a rust template that just created a file with classes with the right names.

philipcraig commented 5 years ago

I'm wondering if we should take an approach of hooking up Rust's BindGen to generate a rust crate from ffig's generated *_c.h file.

value added by ffig over raw BindGen might be that ffig has a defined way of coping with C++ exceptions.

Separately, there is also a concerning statement in the BindGen documentation thus:

* Automatically calling copy and/or move constructors or destructors. Supporting this isn't possible with Rust's move semantics.

Any thoughts/comments/discussion welcomed