F
Federico Mena-Quintero
people.gnome.org/~federico · Personal blog · on HN since 2010
Federico Mena-Quintero, a GNOME developer, writes about maintaining librsvg and porting it from C to Rust.
What HN saysCommenters praise his work and point to his librsvg Rust porting talk and his post on Rust's lack of a stable ABI, discussed in C-to-Rust threads.
46HN people shared it
12linked it in comments
46stories submitted
844story points
5 years agolast shared
2010people per year2026
Most-shared posts
- 1Librsvg, Rust, and non-mainstream architectures5 people · 36 points · first shared 2021 · discussion on HN
- 2Librsvg gets Rusty5 people · 29 points · first shared 2016 · 1 comments on HN
- 3Rust things I miss in C3 people · 340 points · first shared 2018 · 162 comments on HN
- 4Librsvg's build infrastructure: Autotools and Rust3 people · 10 points · first shared 2017 · discussion on HN
- 5Librsvg is almost rustified now3 people · 7 points · first shared 2019 · discussion on HN
- 6"Rust does not have a stable ABI"2 people · 163 points · first shared 2020 · 215 comments on HN
- 7Helping Cairo, the rendering library2 people · 123 points · first shared 2018 · 30 comments on HN
- 8CSS in librsvg is now in Rust, courtesy of Mozilla Servo2 people · 23 points · first shared 2019 · discussion on HN
- 9Replacing C library code with Rust: What I learned with librsvg [pdf]2 people · 9 points · first shared 2017 · discussion on HN
- 10Moving gnome-shell's styles to Rust2 people · 4 points · first shared 2019 · discussion on HN
- 11Gnome themes, an incomplete status report, and how you can help2 people · 3 points · first shared 2021 · discussion on HN
- 12Exposing C and Rust APIs: some thoughts from librsvg2 people · 1 points · first shared 2020 · discussion on HN
- 13Rust+Gnome Hackfest in Berlin, 20171 people · 24 points · first shared 2017 · discussion on HN
- 14Material about Christopher Alexander1 people · 10 points · first shared 2013 · discussion on HN
- 15A Monday rant on various kinds of opinionated people1 people · 7 points · first shared 2012 · 6 comments on HN
What HN people wrote when they linked it
adwhit · 2018-02-19
For more detail into the porting effort, I recommend taking a look at these slides, taken from a talk the author gave last year:
https://people.gnome.org/~federico/blog/docs/fmq-porting-c-to-rust.pdf
"Rust revived my interest in maintainership. It is very empowering to finally have a good language that I can use at the level of the stack where I work."
oblio · 2018-01-10
They should just hire Federico Mena-Quintero: https://people.gnome.org/~federico/index.html#performance-articles :)
The guy is amazing.
ndesaulniers · 2021-02-28
This comes up a lot with my work on compiling the Linux kernel with LLVM. So much so I've made a tier list to describe what I picture as a Venn diagram of support: https://clangbuiltlinux.github.io/
Also recently seen on this topic:
https://people.gnome.org/~federico/blog/librsvg-rust-and-non-mainstrea…
https://www.reddit.com/r/rust/comments/lfysy9/pythons_cryptography_pac…
Jnr · 2021-01-05
Have you tried Rust?
The ABI in Rust is doable: https://people.gnome.org/~federico/blog/rust-stable-abi.html
And it doesn't feel like C++ when writing it. The syntax and language features are nice and feel modern.
It does require more attention because of what it compiles down to, but the compiler is there to help with it.
I haven't been excited about any programming languages in years, but Rust has certainly taken my attention lately.
tmzt · 2020-11-03
You may also consider doing it in Rust.
It's possible to implement GObject subclasses in Rust which little additional overhead as compared to doing it in C, but you get the syntactical niceties of for each loops, traits, and other features of Rust.
librsvg makes good use of these bindings, and is undergoing a rewrite in Rust. Gstreamer bindings are also becoming more complete, and example implementations of many of the standard plugins have been rewritten. The official implementation is still in C though.
Vala is a neat concept though and a pretty clean language.
https://people.gnome.org/~federico/blog/librsvg-gobject-in-rust.html
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs
ploxiln · 2020-07-27
One example: librsvg was rewritten from C into Rust, gradually, while retaining the C API:
https://gitlab.gnome.org/GNOME/librsvg
https://people.gnome.org/~federico/news-2016-10.html
(I do not necessarily endorse this, as I find the dependency on a Rust compiler of very recent vintage, to be much more annoying than depending on any decent C compiler from the last 7 years or so.)
the_why_of_y · 2020-05-24
See also the example of librsvg, a C implementation of SVG that was incrementally translated to Rust by some volunteers over a couple years.
https://people.gnome.org/~federico/blog/exposing-c-and-rust-apis.html
roca · 2019-07-04
Rust FFI is very good. Federico Mena-Quintero's blog has a detailed description of mixing C and Rust code while he rewrote librsvg in Rust. https://people.gnome.org/~federico/blog/librsvg-is-almost-rustified.ht…
steveklabnik · 2019-06-14
See here: https://people.gnome.org/~federico/blog/maintaining-bzip2.html
A project that was not maintained now has a maintainer. Patches will actually be applied centrally. Distros won’t need to maintain their own forks.
bluejekyll · 2018-06-06
Staying a little more focused, I have reasons for none of the languages you mention, but in terms of ease of integration of C and Rust, here’s one real world example: https://people.gnome.org/~federico/blog/librsvg-build-infrastructure.h…
Which recently passed a milestone of having less C than Rust: https://www.reddit.com/r/rust/comments/8ofa0w/librsvg_has_now_more_rus…
At this point I personally find it much easier to move C to Rust than C++, and end up with a much safer codebase.
nbsd4lyfe · 2018-03-08
Cairo is currently desperately asking for development help, so uhh... https://people.gnome.org/~federico/blog/helping-cairo.html
db48x · 2017-01-05
You might also be interested in Frederico's articles on the Rustification process: https://people.gnome.org/~federico/news.html