News for hackers. Stuff that matters.
Re:Build It Yourself by jitl on Friday January 24, 2025 @09:27AM (#42813312)
It’s the same as in C, Rust, or any other programming language I’ve ever used. If you don’t use a library, it doesn’t end up linked in your executable. Don’t want to animate GIFs on your microcontroller, then you don’t write `import “image/gif”` in your source file.

For a microcontroller sized runtime, there’s https://tinygo.org/

I think the lack of strong standard library actually leads to more bloat in your program in the long run. Bloat is needing to deal with an ecosystem that has 4 competing packages for time, ending up with all 4 installed because other libraries you need didn’t agree, and then you need ancillary compatibility packages for converting between the different time packages.

Re:Build It Yourself by IshKebab on Friday January 24, 2025 @10:00AM (#42813617)
> It’s the same as in C, Rust, or any other programming language I’ve ever used. If you don’t use a library, it doesn’t end up linked in your executable.

I don't think that's true. If the standard library is pre-compiled, and it doesn't use `-ffunction-sections` etc. then I'm pretty sure you'll just get the whole thing.

There is experimental support for building Rust's standard library from source, but by default it is pre-compiled.

Re:Build It Yourself by XorNot on Friday January 24, 2025 @10:10AM (#42813779)
It's hardly the case that a good reason to not have a more complete standard library on the basis of having to do a tiny bit more work in a more special case to get binary sizes down.
Re:Build It Yourself by IshKebab on Friday January 24, 2025 @11:02AM (#42814409)
No I totally agree. IMO Rust should have a more complete standard library.