News for hackers. Stuff that matters.
Re:Swift Static Linux SDK by palata on Tuesday June 11, 2024 @05:25PM (#40651691)
As you say, a typical Rust program can easily depend on hundreds of crates that nobody really checks. That's a security issue.

The whole point of a distro is that someone distributes them, so you can choose which distro you want to trust.

What I don't like about Rust and Go is that they enforce their preference. I am fine if you want to link everything statically. I just don't want you to force me.

Re:Swift Static Linux SDK by akira2501 on Tuesday June 11, 2024 @05:36PM (#40651845)
You're not forced to with Go. CGO exists and requires dynamic linking.
Re:Swift Static Linux SDK by newZWhoDis on Tuesday June 11, 2024 @07:38PM (#40652920)
More software should “enforce” their preferences, many decisions are objectively superior and this “anything goes” attitude has done nothing but hurt OSS/Linux adoption.

Everything about the shared lib model is stupid, and has contributed to poor Linux market share to date.

Re:Swift Static Linux SDK by palata on Wednesday June 12, 2024 @08:44AM (#40657464)
I couldn't disagree more.

> Everything about the shared lib model is stupid

I don't think we can discuss if that's you're stance. But also I don't think you understand the shared lib model if you think like that.

Re:Swift Static Linux SDK by lmz on Wednesday June 12, 2024 @09:55AM (#40658208)
Dynamic linking seems to work fine for Windows or OSX. Maybe it's open source + dynamic linking that's the problem.
Re:Swift Static Linux SDK by palata on Wednesday June 12, 2024 @11:37AM (#40659298)
Honestly a problem is that most developers just don't understand how it works. Docker / static linking solves a lack of understanding, mostly. That's why they are popular.
Re:Swift Static Linux SDK by kibwen on Tuesday June 11, 2024 @08:48PM (#40653320)
> I just don't want you to force me.

Rust supports dynamic linking, and has since well before 1.0.

Re:Swift Static Linux SDK by palata on Wednesday June 12, 2024 @08:42AM (#40657453)
In practice, it feels like everybody assumes that Rust is installed through Rustup and dependencies are statically linked from cargo. I have tried going the dynamic linking way, it's painful when it's not impossible.
Re:Swift Static Linux SDK by umanwizard on Wednesday June 12, 2024 @02:56PM (#40661634)
Regardless of what "everybody assumes", you can in fact build rust binaries without using rustup or cargo. Distros do this. Yes, it's more painful for end users than just typing `cargo build`, but that's irrelevant to distro maintainers.
Re:Swift Static Linux SDK by palata on Wednesday June 12, 2024 @05:39PM (#40663481)
Some software (e.g. IDEs) will call `rustup` for some reason (yep, it happened to me and I therefore couldn't use that software).

> Yes, it's more painful for end users than just typing `cargo build`

Cargo is fine, I don't mind installing cargo. I just don't want my packages to be handled by my package manager. I don't want every project to ship their own custom package manager like rustup.

Re:Swift Static Linux SDK by glandium on Wednesday June 12, 2024 @10:27PM (#40665343)
That's kind of a disingenuous take. Rust supports producing dynamically loadable libraries. It doesn't support dynamically linking arbitrary dependencies, which is what most people would understand from "Rust supports dynamic linking" in a discussion about static linking.
Re:Swift Static Linux SDK by kibwen on Thursday June 13, 2024 @12:17AM (#40665881)
> It doesn't support dynamically linking arbitrary dependencies

I don't understand why one would think this. You make it sound as though Rust only supports dynamic linking for glibc, but that's certainly not true.

Re:Swift Static Linux SDK by glandium on Thursday June 13, 2024 @12:40AM (#40666018)
The keyword is "arbitrary". Say you have dependencies on reqwest and clap, want to dynamically link against them? Not gonna happen. That's what people talk about most of the time for static vs. dynamic linking, at least in my circles.