DEV Community

Discussion on: Rust GUI: Introduction, a.k.a. the state of Rust GUI libraries (As of January 2021)

Collapse
 
walkero profile image
George Sokianos

@davidedelpapa Thank you for the awesome research. I would like to ask you which of the above GUI libraries produce the smallest binary, because this is also a necessary information to know. For example the Iced example of yours produced a 213MB binary on my system, and the Druid one is 115.8MB.

It would be interesting to have this information as well. Thank you so much for this work.

Collapse
 
lexiebkm profile image
Alexander B.K.

Wow... hundreds of Mb. This may discourage me to use Rust for desktop GUI.
I am considering to relearn C++ and use Qt.
Java is the other option with Swing already provided in the JDK.
Another very good option is C#. But it requires .Net framework, because the last time I read, .Net Core didn't provide support for Win Forms, WCF, WPF. Besides, C# + .Net are massive technologies that will take longer time to learn and get proficient.
That being said, I still want to continue learning Rust for other purpose, probably for web backend.

Collapse
 
walkero profile image
George Sokianos

I think you missed Davide's comment below. Actually the binary became quite small when I used cargo build --release to build it. So, my comment above is not accurate any more.

Thread Thread
 
lexiebkm profile image
Alexander B.K. • Edited

You are right. Without including debugging feature, by adding --release option, the size would decrease much smaller.
But, when I build and compared two simple button apps, I got the result :

  • Rust app is 17Mb
  • C++ app is only 132Kb. I also tried a small GUI app using C++ that had a feature of simple datagrid (table) where the cells are editable and found the file size was about 1Mb which is acceptable. This type of desktop GUI app is one that I had developed in the past using Visual Basic 6. One thing that I also found when compiling even a small Rust app like that, the compile time was very long on my computer. It could take 1 hour or more.
Collapse
 
davidedelpapa profile image
Davide Del Papa

I think the sizes you are getting are due also to the fact that if you just 'cargo build', you get a debuggable executable. If you 'cargo build --release' you should get smaller bins.

Anyway, yes final size is a valuable metric. I'm planning a retake on this, also because some crates have evolved quite a bit since I tested them, and some are finally usable (yeah). In tht case I will try to spend two words about binary size