modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
23.15k stars 2.59k forks source link

[BUG]: Mojo hello world binary size unreasonably large #2419

Open vrakesh opened 6 months ago

vrakesh commented 6 months ago

1751 seems to re-appearing in v24.2.1

cat world.mojo 
fn main():
    print("Hello world")
$ mojo --version
mojo 24.2.1 (2f0dcf11)
$ mojo build world.mojo
$ ./world 
Hello world
$ du -hs world.mojo 
4.0K    world.mojo
$ du -hs world
4.3M    world
$ uname -a
Linux pop-os 6.8.0-76060800daily20240311-generic #202403110203~1713206908~22.04~3a62479 SMP PREEMPT_DYNAMIC Mon A x86_64 x86_64 x86_64 GNU/Linux

On linux the binary size for hello world is 4.3MB by default

VMois commented 6 months ago

FYI, on MacOS, the size of Hello World is 577KB.