News for hackers. Stuff that matters.
Re:Zig cc: A drop-in replacement for GCC/Clang by admax88q on Tuesday March 24, 2020 @10:16PM (#22681394)
Have you measured it? How much is dynamic linking saving you? How many processes are you running on embedded systems with of 256MB or RAM?
Re:Zig cc: A drop-in replacement for GCC/Clang by __d on Sunday March 29, 2020 @08:08PM (#22723958)
Ok, so I just measured with a C "hello world".

My dynamically-linked executable is 8296 bytes on disc. My statically-linked executable is 844,704 bytes on disc.

So if I had a "goodbye world" program as well, that's a saving of about 800KB on disc.

Now one can argue the economics of saving a bit under a megabyte in a time where an 8GB microSD card costs under USD5 in single quantities, but you can't argue that it's a relatively big saving.

At runtime, the dynamic version uses (according to top) 10540 KB virtual, 540 KB resident, and 436 KB shared. The static version uses 9092 KB virtual, 256 KB resident, and 188 KB shared.

I haven't investigated those numbers.

Re:Zig cc: A drop-in replacement for GCC/Clang by saagarjha on Tuesday March 24, 2020 @11:46PM (#22681777)
256MB of RAM is a fairly large amount–this is how much iPhone 3GS had, for instance. It relied on dynamic linking to system libraries heavily and ran multiple processes.
Re:Zig cc: A drop-in replacement for GCC/Clang by jfkebwjsbx on Wednesday March 25, 2020 @04:03AM (#22682778)
That proves the point: with multi-GiB memory nowadays you can fit many times over all the space that the iPhone saved using dynamic linking.
Re:Zig cc: A drop-in replacement for GCC/Clang by saagarjha on Wednesday March 25, 2020 @01:34PM (#22686712)
I would rather not be limited on my laptop to iPhone apps from ten years ago.