News for hackers. Stuff that matters.
Re:"Rust does not have a stable ABI" by dTal on Thursday August 13, 2020 @10:30AM (#24143681)
Yes, it's a concern. Firstly, hard drive space isn't the only reason to make binaries small - you have RAM pressure, cache pressure, and bandwidth to save. Secondly and more importantly, waste adds up. If you replaced every binary on the system with a Rust equivalent - which, to listen to some advocates, is the eventual goal - you could end up with a base system that's many times larger.

In a larger sense, something that sets out to be a "systems programming language" needs to be exactly the sort of thing suitable for a tiny embedded system, even if it isn't running on one, because everything else builds on top of it. The attitude that "we have tons of power, why not waste it" just doesn't fly at the very lowest levels. You can write a desktop application in Python, and it's broadly fine - but try writing an OS kernel!

Re:"Rust does not have a stable ABI" by zaarn on Thursday August 13, 2020 @11:07AM (#24144084)
There are patches that let Rust run on ESP32 systems, so think it's entirely suitable for tiny embedded things. What makes it bloaty is the linked in standard library, but it's not an unsolvable crisis; you can dynlink against glibc, there is a crate for core rust IIRC. That'll get you reasonably sized rust applications.

And for writing kernels the same applies; without the stdlib, it gets a lot smaller very fast. I've done it, so I think I can count myself on having some experience there. The biggest part of my kernel is a 128KB scratch space variable it uses during boot as temporary memory until it has read the memory mappings from the firmware and bootstrapped memory management on a basic level. The remainder of the kernel (minus initramfs) is then about 1MB large, the largest part after the 128KB scratch space using about 96KB.

Re:"Rust does not have a stable ABI" by nwallin on Thursday August 13, 2020 @05:43PM (#24149764)
Regarding embedded, you generally only have one program. So dynamic linking buys you precisely nothing in that space.
Re:"Rust does not have a stable ABI" by zaarn on Thursday August 13, 2020 @11:57PM (#24153157)
Depends on if embedded refers to microcontrollers or just single board computers in various devices, but it wouldn't buy you much either way, yes.
Re:"Rust does not have a stable ABI" by nemothekid on Thursday August 13, 2020 @11:18AM (#24144238)
>Firstly, hard drive space isn't the only reason to make binaries small - you have RAM pressure, cache pressure, and bandwidth to save.

FWIW, this is does not seem to be empirically true. The savings are possible in theory, but false in practice.

https://drewdevault.com/dynlib.html

The most used largest libraries, like libc and libpthread, would be dynamically linked by Rust anyways.