News for hackers. Stuff that matters.
Re:Dependency on rust removes support for a number of platforms by pornel on Monday February 08, 2021 @08:44PM (#26072843)
It's unfortunate that some platforms got dropped, but OTOH all these platforms seem to be 30 years old, niche, and discontinued by their original manufacturers.

If someone has antique computer that still works, that's great, but they shouldn't expect to have the latest software for it.

Re:Dependency on rust removes support for a number of platforms by Isinlor on Monday February 08, 2021 @08:51PM (#26072893)
Indeed. If the platforms are business critical then an impacted company should put money on the table to do the necessary work.

If they are not critical then well, why should other people care?

Also, Python packaging is pure hell.

Re:Dependency on rust removes support for a number of platforms by moosingin3space on Monday February 08, 2021 @09:15PM (#26073083)
What's more, the Gentoo maintainer that filed the issue lists a number of platforms that CPython itself doesn't even support.
Re:Dependency on rust removes support for a number of platforms by rudedogg on Monday February 08, 2021 @08:50PM (#26072880)
> Only users on Alpine (musl), BSD, other hardware platforms, and distro packagers are affected.

Not just niche or antique!

Re:Dependency on rust removes support for a number of platforms by pornel on Monday February 08, 2021 @08:57PM (#26072931)
Rust supports musl and a bunch of BSDs, so if something broke with their packages, it should be only a matter of fixing the builds. That's a much smaller problem than adding a new old architecture to LLVM and rustc.
Re:Dependency on rust removes support for a number of platforms by moosingin3space on Monday February 08, 2021 @09:13PM (#26073072)
Indeed, a commenter demonstrates that resolving the issue on Alpine Linux was as simple as adding an `apk add rustc cargo` to their Dockerfile.
Re:Dependency on rust removes support for a number of platforms by nenolod on Tuesday February 09, 2021 @04:25PM (#26082560)
It's not just about adding new architectures to LLVM and rustc, it's also about bootstrapping supported architectures on all architectures supported by a distribution.

This isn't fully done in Alpine yet, and took a long time to do in Debian.

Re:Dependency on rust removes support for a number of platforms by CyberRabbi on Monday February 08, 2021 @08:51PM (#26072889)
This is the sort of opinion that evaporates once you become the victim of what’s happening here.

IMO Rust should have a C backend, then the maintainers could drop it as a build dependency and not break existing platforms. Though I expect there to be political reasons for Rust’s conspicuous lack of a C backend.

Re:Dependency on rust removes support for a number of platforms by pornel on Monday February 08, 2021 @09:00PM (#26072966)
There's mrustc which compiles Rust to C. Rustc itself supports two back-ends now (LLVM and cranelift), so more should be possible if someone wanted to contribute and maintain them.

I don't think there's any ideological opposition to having more back-ends. It's just a huge amount of work, and is lacking volunteers, especially for niche platforms.

Re:Dependency on rust removes support for a number of platforms by CyberRabbi on Monday February 08, 2021 @09:08PM (#26073037)
The amount of work doesn’t seem to be the limiting factor. Rewriting large amounts of C code into Rust is a lot of work too but that doesn’t stop Rust justice warriors from doing that.
Re:Dependency on rust removes support for a number of platforms by moosingin3space on Monday February 08, 2021 @09:19PM (#26073110)
For one, respected community member pcwalton has argued against compiling to C, citing the difficulty in producing performant, memory-safe output.

For another, from personal experience, I can comment that compiling to C in such a way that doesn't leak abstractions left and right is quite challenging. It's pretty hard to produce memory-safe C, so it's a ton of work, and the payoff is pretty marginal, as the most important platforms already are supported by LLVM.

Re:Dependency on rust removes support for a number of platforms by CyberRabbi on Monday February 08, 2021 @09:28PM (#26073177)
Automatically generating “memory safe” C is no harder than automatically generating “memory safe” LLVM bitcode.
Re:Dependency on rust removes support for a number of platforms by brundolf on Monday February 08, 2021 @10:46PM (#26073557)
I think the issue is all of C's undefined behavior
Re:Dependency on rust removes support for a number of platforms by ghoward on Monday February 08, 2021 @11:53PM (#26074026)
For the most part, that can be worked around as well, with careful use of unsigned arithmetic. See https://git.yzena.com/Yzena/Yc/src/branch/master/include/yc/... for some examples. All arithmetic is unsigned, but I use it to simulate 2's complement signed.
Re:Dependency on rust removes support for a number of platforms by CyberRabbi on Tuesday February 09, 2021 @04:21AM (#26075446)
That is not difficult to avoid if you are generating short primitives. You can for the most part just convert the LLVM bitcode that the Rust compiler would output to the equivalent C snippet. Since each snippet is short, you can trivially check if it invokes undefined behavior. LLVM bitcode also can exhibit undefined behavior.
Re:Dependency on rust removes support for a number of platforms by moosingin3space on Tuesday February 09, 2021 @09:28PM (#26085136)
> You can for the most part just convert the LLVM bitcode that the Rust compiler would output to the equivalent C snippet.

Sounds like a good argument to resurrect the LLVM C backend. As it stands, the Rust core team has no desire to implement a C backend, as it would be a ton of work for not much gain.

Re:Dependency on rust removes support for a number of platforms by phkahler on Monday February 08, 2021 @09:24PM (#26073148)
>> IMO Rust should have a C backend, then the maintainers could drop it as a build dependency and not break existing platforms.

That's a lot of work you expect from people developing a language you don't even want to use.

Re:Dependency on rust removes support for a number of platforms by CyberRabbi on Monday February 08, 2021 @09:26PM (#26073165)
I expect nothing, it is a casual opinion. You’re projecting.
Re:Dependency on rust removes support for a number of platforms by correct_horse on Monday February 08, 2021 @08:57PM (#26072932)
LLVM had a C backend which went unmaintained until the Julia folks picked it up and updated it for LLVM 10. I'm not sure about its current state.
Re:Dependency on rust removes support for a number of platforms by pca006132 on Monday February 08, 2021 @09:01PM (#26072970)
I think there are alternative implementations that are (much) less mature than rustc. And I wonder if using those implementations would be good for a project, that requires security...