Damn... Rust devs going crazy with these libraries.

⚒️ **sledgehammer_bindgen** 🦀

💥 Breaking the performance barrier of WASM/JS communication.

⚡ Faster Rust batched bindings for JS code.

⭐ GitHub: https://github.com/ealmloff/sledgehammer_bindgen

#rustlang #webassembly #wasm #javascript #performance #bindings #frontend #bindgen

Published my first crate today to https://crates.io/crates/nvtiff-sys! Rust bindings to the nvTIFF (Nvidia TIFF encoder/decoder) library.

Interface is not very friendly (need to use lots of unsafe), so definitely don't use it in production yet. But hoping it'll help to GPU-accelerate TIFF image processing (especially for geospatial or medical imaging workloads) once I wrap my head around how to handle raw pointers and lifetimes.

#rustlang #bindgen #tiff #GeoTIFF

crates.io: Rust Package Registry

It's now Yvan Sraka's @yvan turn! Presenting "Beyond proc-macros".

#RustInParis #RustLang #ProcMacros #FFI #bindgen

question to all the #rustlang #FFI experts out there: Within a bigger C code base I like to replace some C code with Rust. I have a existing C header file describing the API and data types which I really don't like to touch. And it seems like this use-case is not really covered by bindgen or cbindgen.

#bindgen helps to generate Rust types, etc. from header files but assumes that your goal is to call from Rust into existing C code. All API functions are inside `extern` blocks.

We wrapped up our work on rust-bindgen and handed it over to its original maintainer @emilio. Thanks to Prossimo and Emilio for the trust they placed in us.

You can read about our major work and milestones achieved in Prossimo's blog post https://www.memorysafety.org/blog/automating-releases-bindgen/

#ffi #bindgen #rust #rustlang

Automating Releases for Bindgen

Bindgen is an important tool for helping to accelerate the transition from C and C++ to Rust because it generates FFI bindings. We knew that improving the robustness of bindgen would advance our efforts of bringing memory safety to critical infrastructure. We've been working with Ferrous Systems to make improvements to bindgen. This post summarizes their most recent work. Josh Aas, Head of ISRG's Prossimo project Ferrous Systems maintained bindgen through the end of 2023, and we're excited to share an update on our contributions to this project.

Prossimo
There is also a blog post by Lars Bergstrom: https://security.googleblog.com/2024/02/improving-interoperability-between-rust-and-c.html There Lars mentions some of the cool #Rust crates that we've contributed to: #cxx, #autocxx, #bindgen, #cbindgen, #diplomat, and #crubit. Some of these projects are from #Google, others are open source projects that we use and contribute to.
Improving Interoperability Between Rust and C++

Posted by Lars Bergstrom – Director, Android Platform Tools & Libraries and Chair of the Rust Foundation Board Back in 2021, we announced...

Google Online Security Blog

Fixed a critical bug in **rust-bindgen**!

🐛 PR: https://github.com/rust-lang/rust-bindgen/pull/2678

🦀 **rust-bindgen**: Automatically generates Rust FFI bindings to C (and some C++) libraries.

⭐ GitHub: https://github.com/rust-lang/rust-bindgen

#rust #bindgen #c #cpp #ffi #bindings #opensource #contribution

fix(args): make header argument optional by orhun · Pull Request #2678 · rust-lang/rust-bindgen

fixes #2677

GitHub

Interesting. It seems that Rust's bindgen (the magic that turns C libraries into Rust libraries) does translate constant #define macros, but not "function-like" macros that take arguments. So you will have a bad time trying to port a C library that uses a lot of those.

More info: https://github.com/rust-lang/rust-bindgen/issues/753

#RustLang #bindgen

Functional C macros are not expanded. · Issue #753 · rust-lang/rust-bindgen

So I'm generating bindings to <linux/uinput>. This works pretty well, but two c macros in particular do not produce any bindings in the output. Reduced input below: Input C/C++ Header #define UI_DE...

GitHub

Use Rust async functions and methods in Swift, Kotlin and Python, https://github.com/mozilla/uniffi-rs/pull/1409.

It's ready! Large PR, sorry for the reviewers.

#RustLang #kotlin #SwiftLang #future #async #uniffi #bindgen

feat: Add support for async/Future by Hywan · Pull Request #1409 · mozilla/uniffi-rs

Quick explanation This is a patch to add support for async/Future inside uniffi-rs. At the time of writing, it works very well with Python, Swift and Kotlin. Any Future<Output = T> or Future<Output...

GitHub
Long shot, i know, but does anyone have experience with #Bindgen in #Rust? I am getting a bit stuck.