Comment by ๐Ÿ”ญ DocEdelgas

Re: "How do I reduce binary size when compiling a Hare program?โ€ฆ"

In: s/Harelang

Thanks for the reply. After checking the implementation of strings::toutf8 in the standard library, I rewrote the Hello World program like this:

The resulting stripped binary is, unfortunately, the same size.

๐Ÿ”ญ DocEdelgas [OP]

2023-11-20 ยท 2 years ago

Original Post

๐ŸŒ’ s/Harelang

๐Ÿ”ญ DocEdelgas:

How do I reduce binary size when compiling a Hare program? I compiled the example Hello World program as depicted on the official website, and the binary size is ~121kB after stripping. I then tried to rewrite the Hello World program using io::write and strings::toutf8, and the stripped binary is ~34kB. Is there any way to reduce binary size even further, using lto or compiler flags? The source code of the modified Hello World is this: [preformatted]

๐Ÿ’ฌ 2 comments ยท 2023-11-18 ยท 2 years ago