Rust on top of a C/C++ lib is not fun, that’s for sure. It has to setup a firewall around C which adds complexity. Using a rust native framework is better, IMO. Slint and egui are good examples thereof.
Yeah, I wrote two “plugins” some time ago and the Assembly implementation was shorter than the Rust implementation due to the need to convert from C ABI and back 😅.
I have taken a look at both Slint and Egui before, but they didn’t seem to integrate that well with the Linux desktop last time. I just checked again and it seems like Slint has a Qt backend now which is nice. I don’t really like immediate GUI frameworks, but JavaFX has so far been my favorite framework to work with so maybe I’m just weird.
And yes, I have used min-sized-rust’s tricks for several of my projects, and it’s very effective. However statically compiling just doesn’t compare to using C and linking with the system libraries.
JavaFX has so far been my favorite framework to work with so maybe I’m just weird
I found Java Swing to be the easiest GUI framework to use. Never tried JavaFX. Would you call it an upgrade?
However statically compiling just doesn’t compare to using C and linking with the system libraries.
Rust does support dynamic linking (doc, stackoverflow), but AFAIK the crate has to explicitly be configured to do so (I might be mistaken though as I’ve never tried it). And from what I gather the rust ABI isn’t stable (which is a pity) so it’s “safer” to output a cdy-lib than a dy-lib.
Maybe in the future the rust ABI will be stabilized.
It is definitely an improvement over Java Swing. One thing I really love and miss with other frameworks is how easy it is to connect properties with each other. All values are exposed as Properties and Values. Values can be listened to, mapped and used. They are similar to RXJS’s Observables except that you can always get the internal value without a lastValueFrom that may fail. Properties can also be listened to, mapped, etc but their value can also be set from everywhere (RXJS instead has Subjects which can only be set from inside the constructor). It’s a really easy, yet powerfull system. I have yet to find a single framework that does that part as well as it does.
And regarding Rust lack of stable ABI, even if that’s resolved (and last time I checked there wasn’t much interest from within). The main Linux distributions will still have to ship the Rust stdlib as a shared library to be able to reliably depend on it being available.
I do wonder if it would be advantageous to write a safe wrapper around the C and C++ standard libraries. It would mean being able to use it’s functionality, while being relatively sure that those dependencies are available while only having to add a little extra code (and thus size) to the executable for the wrappers.
Rust on top of a C/C++ lib is not fun, that’s for sure. It has to setup a firewall around C which adds complexity. Using a rust native framework is better, IMO. Slint and egui are good examples thereof.
As for application size, check this out.
Anti Commercial-AI license
Yeah, I wrote two “plugins” some time ago and the Assembly implementation was shorter than the Rust implementation due to the need to convert from C ABI and back 😅.
I have taken a look at both Slint and Egui before, but they didn’t seem to integrate that well with the Linux desktop last time. I just checked again and it seems like Slint has a Qt backend now which is nice. I don’t really like immediate GUI frameworks, but JavaFX has so far been my favorite framework to work with so maybe I’m just weird.
And yes, I have used min-sized-rust’s tricks for several of my projects, and it’s very effective. However statically compiling just doesn’t compare to using C and linking with the system libraries.
I found Java Swing to be the easiest GUI framework to use. Never tried JavaFX. Would you call it an upgrade?
Rust does support dynamic linking (doc, stackoverflow), but AFAIK the crate has to explicitly be configured to do so (I might be mistaken though as I’ve never tried it). And from what I gather the rust ABI isn’t stable (which is a pity) so it’s “safer” to output a cdy-lib than a dy-lib.
Maybe in the future the rust ABI will be stabilized.
Anti Commercial-AI license
It is definitely an improvement over Java Swing. One thing I really love and miss with other frameworks is how easy it is to connect properties with each other. All values are exposed as Properties and Values. Values can be listened to, mapped and used. They are similar to RXJS’s Observables except that you can always get the internal value without a lastValueFrom that may fail. Properties can also be listened to, mapped, etc but their value can also be set from everywhere (RXJS instead has Subjects which can only be set from inside the constructor). It’s a really easy, yet powerfull system. I have yet to find a single framework that does that part as well as it does.
And regarding Rust lack of stable ABI, even if that’s resolved (and last time I checked there wasn’t much interest from within). The main Linux distributions will still have to ship the Rust stdlib as a shared library to be able to reliably depend on it being available.
I do wonder if it would be advantageous to write a safe wrapper around the C and C++ standard libraries. It would mean being able to use it’s functionality, while being relatively sure that those dependencies are available while only having to add a little extra code (and thus size) to the executable for the wrappers.