Madrid GNOME+Rust Hackfest, part 2

- gnome, hackfests, librsvg, rust

Hacking on gnome-class continues apace!

Philippe updated our dependencies.

Alberto made the syntax for per-instance private structs more ergonomic, and then made that code nice and compact.

Martin improved our conversion from CamelCase to snake_case for code generation.

Daniel added initial support for GObject properties. This is not finished yet, but the initial parser and code generation is done.

Guillaume turned gir, the binding generator in gtk-rs, from a binary into a library crate. This will let us have all the GObject Introspection information for parent classes at compilation time.

Antoni has been working on a tricky problem. GTK+ structs that have bitfields do not get reconstructed correctly from the GObject Introspection information — Rust does not handle C bitfields yet. This has two implications. First, we lose some of the original struct fields in the generated bindings. Second, the sizes of the generated structs are not the same as the original C structs, so g_type_register_static() complains that one is trying to register an invalid class.

Yesterday we got as far as reading the amd64 and ARM ABI manuals to see what the hell C compilers are supposed to do for laying out structs with bitfields. Most likely, we will have a temporary fix in gir's code generator so that it generates structs with the same layout as the C ones, with padding in place of the space for bitfields. Later we can remove this when rustc gets support for C bitfields.

I've been working on support for GObject interfaces. The basic parsing is done; I'm about to refactor the code generation so I can reuse the parts that fill vtables from classes.

Yesterday we went to the Madrid Rust Meetup, a regular meeting of rustaceans here. Martin talked about WebRender; I talked about refactoring C to port it to Rust, and then Alex talked about Rust's plans for 2018. Fun times.

Sponsored by the GNOME Foundation

Hosted by OpenShine