Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Bindgen – Rust tool for generating C bindings (jvns.ca)
97 points by ingve on Dec 21, 2017 | hide | past | favorite | 6 comments


Bindgen is really awesome, makes is dead-simple to integrate with existing libraries.

That said the only place where there's a little friction is around macros since they need to be evaluated in context. However it's easy to use another header to declare them as static const/discrete function and then bindgen picks them up just fine.


Big fan of bindgen. Two libraries i created already use it - rustrpg (rust for postgres) - torch-rust


A great post from Julia, as always :)

Bindgen has some support for C++ stuff too! Firefox uses it pretty heavily.


The C++ support is impressive. It doesn't work well enough to handle "idiomatic" C++ libraries, with templates all over the place, but that it works as well as it does is really impressive.


reverse - cbindgen - seems quite useful, too! i didn't know it existed until this post.


Another excellent post by Julia Evans.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: