![]() Īs to why "those tricks" are not included in the official dev tools. Julia fractals in Rust wasm - Rasmus.krats.se, and Cliffle made things even smaller in the pages linked to by. When compiling to wasm, I wrote a julia renderer in rust and compiled to 907 bytes of wasm. But for a real c program, where more symbols are declared in the program itself, it is as important to strip a c program as a rust program in cases where size matters. The same is true for c, but as the standard library is often dynamically linked there, the difference is less drastic from 25 k to 15 k. This reduces the 3.2 M hello world to about 271 k. In many cases these should just be removed by running strip the_binary. Similarly web assembly: Making really tiny WebAssembly graphics demos - CliffleĪ very large part of the size is debug symbols. On the other hand, when people want to squeeze Rust code into the tiny space available on micro-controllers it can be done: Rewriting m4vgalib in Rust - Cliffle Given the huge amount of storage and RAM we generally have, even on low end machines, I'm not about to worry about this. I notice rustc is only 8.3Mb on my machine. I'm just tinkering with a 3000 line program that pulls in 123 crates and compiles to about 4Mb. Once you have the std library and some crates linked in your code will only grow by the small amount generated for each line you write. But that does not mean that a 10 line program will compile to 32Mb, an 100 line program to 320Mb etc. ![]() I don't think we need be scared about this.Ĭertainly a 3.2Mb executable is a lot for what is effectively one line of functionality in "hello world". I encountered something that makes me be scared to use it in commercial projects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |