gi-rust / grust

GObject introspection bindings for the Rust programming language
GNU Lesser General Public License v2.1
37 stars 3 forks source link

What happened to the project? #27

Open amezin opened 3 years ago

amezin commented 3 years ago

I like the idea of explicit Ref smart pointer more than gtk-rs approach. I think it is better because:

1) When reading the code, you immediately see that it is just a reference, and it's obvious that .clone() will only create a new reference

2) It seems that GObject subclassing would be easier this way (compared to current gtk-rs)

However, I see that there has been no commits since 2018. Why? Are there any fundamental issues in this project that can't be resolved?

mzabaluev commented 3 years ago

Thanks for your interest! One of the reasons I stopped spending time on this is a representability gap between gobject-introspection and the level of detail that would be needed for Rust bindings to be ergonomic. The whole idea was to be able to generate bindings from introspection XML, but many things had to be overridden by added-on configuration, either because of incorrect introspection annotations, or plain lack of information in the gobject-introspection data. The biggest issues were in thread safety (most of the objects are not Send, but some others are meant to be sent between threads) and ownership semantics of closures. Some of the features I needed were unstable or only promulgated as RFCs in Rust at the time.

I got to generating complete low-level FFI bindings for GLib, GObject, and Gio with a lot of manual tweaking, at which point it became clear that every other major library would take a similar amount of effort, and you can never be sure that the bindings came out correct without testing each FFI endpoint, or at least verifying that things like structure member offsets and alignments came out the right way. This is not even touching potential issues with the high-level bindings. With gtk-rs having already attracted a dedicated community, I saw little value in continuing on my own.