News for hackers. Stuff that matters.
Re:Supporting Linux kernel development in Rust by boogies on Monday August 31, 2020 @04:16PM (#24335492)
Probably a crazy unpopular opinion, but I kind of agree with the Hyperbola (GNU / formerly Linux-libre, in future using a fork of the OpenBSD kernel https://itsfoss.com/hyperbola-linux-bsd/) devs that Rust in Linux is not necessarily a good thing, for the reasons they mentioned when they announced they were switching kernels (https://www.hyperbola.info/news/announcing-hyperbolabsd-road...) (Edit: and the LLVM dependency).
Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @04:40PM (#24335708)
The vast majority of the text in that post is inaccurate and hyperbolic. Linux is not "forcing adoption of HDCP" (it's just something Linux has a driver for), Rust does not require internet access to use (and the trademark comments are not particularly accurate either), the Kernel Self Protection Project is alive and well and making new improvements in every new version of the kernel (see Kees Cook's regular blog posts for details), systemd is not spelled "SystemD", gettext has no dependency on Java (and the link in that post explains that). And in general, decisions about what technologies to use are made by those who show up and do the work to build viable solutions, not by people who snark.

It's a rant by an obscure one-developer distribution that formerly used the Linux kernel. Some people are never happy no matter what you do, and if you make the mistake of treating their rants as useful feedback, you get a list of 30 more demands before they'd consider gracing your little project with the honor of their all-important usage again.

Re:Supporting Linux kernel development in Rust by R0b0t1 on Tuesday September 01, 2020 @12:54PM (#24343820)
>Rust does not require internet access to use

This is debatable. The default workflow requires access to crates.io, and it is pretty hard to not use crates.io.

Re:Supporting Linux kernel development in Rust by steveklabnik on Tuesday September 01, 2020 @12:57PM (#24343867)
It is well supported by the project itself, we offer a variety of tools so that you do not need internet access, and this was also a hard requirement of a lot of our early important users, like Firefox and various distros.

Even with using crates from crates.io.

Re:Supporting Linux kernel development in Rust by R0b0t1 on Tuesday September 01, 2020 @02:57PM (#24345501)
If crates.io was down tomorrow there would be a major disruption to you if you were using Rust for development. That is their point, as well as potentially exploring other reasons.

As someone who uses a source-based distro I hate language package managers. They always end up inferior to a distro package manager and create extra work for everyone, including the language developers, who tolerate it because it is in their favorite language.

Re:Supporting Linux kernel development in Rust by steveklabnik on Tuesday September 01, 2020 @04:33PM (#24346726)
It would only be an issue if I wanted to use crates that weren’t in my local cache already. And that’s gonna be true of any build system. It would also be true of any distro package manager.
Re:Supporting Linux kernel development in Rust by R0b0t1 on Wednesday September 02, 2020 @11:59AM (#24354485)
Most other software is more dispersed and has plenty of mirrors, e.g. the Debian project. The same criticism of crates.io is typically levied against GitHub.
Re:Supporting Linux kernel development in Rust by ColanR on Monday August 31, 2020 @04:57PM (#24335855)
I think you were being "inaccurate and hyperbolic".

> Linux is not "forcing adoption of HDCP" (it's just something Linux has a driver for)

What they actually said in the article:

> Historically, some features began as optional ones until they reached total functionality. Then they became forced and difficult to patch out. Even if this does not happen in the case of HDCP, we remain cautious about such implementations.

Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @05:03PM (#24335931)
My comment was entirely based on the second link. Direct quote from that:

> Linux kernel forcing adaption of DRM, including HDCP.

(Which linked to a patch adding driver support for handling HDCP, with absolutely no possibility of it somehow being forced.)

Regarding the quote from that interview: sure, and there's also no guarantee that the Linux kernel won't drop support for every architecture except SPARC, except of course for all the people involved not putting up with it. In what possible universe would Linux developers decide it was a good idea to mandate HDCP? It's completely unfounded and unsupported hyperbole and fearmongering, without even a hint of potential truth.

It's also roughly consistent with what I'd expect from someone who thinks that gettext daring to have support for Java and C# format strings is a horrific problem that should be ripped out by the roots.

Re:Supporting Linux kernel development in Rust by boogies on Monday August 31, 2020 @05:43PM (#24336233)
I don’t know about Linux, but Mozilla has mandated many things that I would have hoped it never would have, like XUL depreciation, and especially added many anti-features to their largest product, deciding each was not their hill to die on https://news.ycombinator.com/item?id=24124954. I left Firefox and have never regretted it. The Hyperbola devs did the same, and I will be happy to try their OS and support them fighting on every hill they find, no matter how tiny or unimportant it seems to larger organizations.
Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @06:06PM (#24336379)
> like XUL depreciation

There were specific reasons for that: https://yoric.github.io/post/why-did-mozilla-remove-xul-addo...

Re:Supporting Linux kernel development in Rust by boogies on Tuesday September 01, 2020 @10:57AM (#24342452)
Oops. This is why I try not to rush HN comments. This one I did and tried to remove my partial list of complaints about Mozilla and left one element, that’s not the most important one.¹

Mozilla markets Firefox as ‘the only browser made for people, not profit’. But they’ve done the exact opposite time and time again. Virtually the single most prominent UI element, the omnibar, has been sold out to the single largest threat to the open web, the gatekeeper to the entire internet to the vast majority of its users. I don’t want to spend all day railing against Mozilla, as easily as I could, but I can easily find a couple other examples off the top of my head. The Mr. Robot scandal is another example of selling out and (not necessarily directly harming but very significantly) alienating users. And it’s been a few years since I’ve used FF as my main browser but I still remember every time I installed it on a new device going into settings and changing default after default to revert it back from a profit-seeking product to a personal tool, disabling telemetry, etc.

1: Although it does make a difference to me. I’d use pre-Chromium Edge if it was FLOSS, on my OS, and let me use Pentadactyl. The excuses for XUL’s removal — security, stability, and speed — don’t concern me: https://yoric.github.io/post/why-did-mozilla-remove-xul-addo... seems to claim it would allow someone to somehow steal my passwords. I’ve been using Palemoon for years and I don’t have any weird activity on any of my accounts, and I keep my browser sandboxed (something Firefox should do better by default, one way it’s behind Chromium) so I don’t have any other security worries. I have no stability or speed issues, and maintainability seems like a non-issue given that an apparently one-man main team keeps Palemoon running.

Re:Supporting Linux kernel development in Rust by boogies on Monday August 31, 2020 @05:19PM (#24336080)
I was going to comment similarly. The comment could be described as “inaccurate and hyperbolic”: if spelling counts, the second link does not say Linux was “forcing adoption [emphasis added] of HDCP.” Systemd stinks and I don’t care how it’s spelled as long as it’s sent to … nvm. And the Hyperbola devs have shown up, done the work, and ported pacman to their kernel, not making the mistake of listening to hyperbolic haters.
Re:Supporting Linux kernel development in Rust by Foxboron on Monday August 31, 2020 @06:39PM (#24336593)
> And the Hyperbola devs have shown up, done the work, and ported pacman to their kernel, not making the mistake of listening to hyperbolic haters.

Where? I was curious as there has been no upstream improvements. And there are no new code in what I assume is their upstream repository?

https://libregit.org/Hyperbola/hyperman

Re:Supporting Linux kernel development in Rust by jcranmer on Monday August 31, 2020 @04:29PM (#24335599)
If I'm understanding correctly, the only reason for not using Rust is... Rust is trademarked?
Re:Supporting Linux kernel development in Rust by est31 on Monday August 31, 2020 @04:44PM (#24335741)
Wait till we tell them that Linux is a trademark of Linus Torvalds.
Re:Supporting Linux kernel development in Rust by captn3m0 on Monday August 31, 2020 @05:06PM (#24335962)
it involves the "patches-must-be-approved-by-upstream" to still be called Rust clause that Rust inherits from the Mozilla Trademark policy. Its the same policy that led to the creation of IceWeasel/Waterfox etc.
Re:Supporting Linux kernel development in Rust by steveklabnik on Monday August 31, 2020 @05:21PM (#24336083)
The root issue with Iceweasel was the logo, in my understanding. It was also resolved years ago. Rust does not inherit these problems, and even then, Mozilla will not be holding these trademarks anymore, even though I do not expect our policy will change once ownership changes.

We do also, you know, give permission.

Re:Supporting Linux kernel development in Rust by hyperman1 on Tuesday September 01, 2020 @05:50AM (#24340027)
Here is the core of the issue:

https://lwn.net/Articles/118279/

Debian wanted to allow anyone to patch their firefox. Mozilla said OK, but not with our name attached to it.

And this makes sense on some level : No project wants to provide support for someone else's bugs.

Re:Supporting Linux kernel development in Rust by est31 on Tuesday September 01, 2020 @06:04PM (#24347672)
For a desktop app it's understandable, but tons of scripts rely on the existence of rustc and cargo binaries. If the fork has to rename it to not-rustc just because it added e.g. gcc support, then that's going to break all the scripts.
Re:Supporting Linux kernel development in Rust by dijit on Monday August 31, 2020 @04:37PM (#24335676)
I'm generally in support of rust in the kernel, but in the interest of playing devils advocate: Would adding more and more dependence on rust mean that it ties the kernel to a single set of compilers?

I can see why people would be opposed to that.

I'm thinking about LLVM (and, obviously, rustc)

Re:Supporting Linux kernel development in Rust by danudey on Monday August 31, 2020 @04:47PM (#24335782)
The Linux kernel would only compile with GCC for... decades? I think? So it's not really a new thing. It would be really nice if the kernel did have first-class support for LLVM and Clang directly (rather than having to set a bunch of environment variables to set the compiler, the linker to use with that compiler, various variables, etc.

That said, it would certainly be uncomfortable to move from "it compiles with Clang, though it's a pain, or GCC, which works fine" to "it compiles with GCC, if you don't use any of this functionality, or LLVM only, if you want any of these features or anything that depends on them".

Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @04:54PM (#24335831)
Originally, we thought that Linux maintainers were asking us to only support kernels compiled with Clang, because they didn't want to support code built with two different compilers. However, in the session, Greg Kroah-Hartman specifically said that if it works to build Rust code with the LLVM-based rustc and C code with GCC and link the two together, and there aren't any problems in practice, then that's perfectly fine.

So, we're currently expecting that supporting Rust will not place any requirements on the C compiler you use, unless you want to use cross-language LTO (which we'll eventually want to do, but it won't be a hard requirement for a working kernel).

Re:Supporting Linux kernel development in Rust by robocat on Monday August 31, 2020 @07:45PM (#24337057)
Article discussing LTO (Link Time Optimizations, used by Google Pixel) and PGO (Profile Guided Optimizations): https://www.phoronix.com/scan.php?page=news_item&px=Microsof...
Re:Supporting Linux kernel development in Rust by jcranmer on Monday August 31, 2020 @05:01PM (#24335905)
> unless you want to use cross-language LTO (which we'll eventually want to do, but it won't be a hard requirement for a working kernel).

Does Linux even work with LTO right now? It seems to do a lot of weird-linking-magic things that I wouldn't expect to work well with LTO.

Re:Supporting Linux kernel development in Rust by geofft on Monday August 31, 2020 @09:22PM (#24337595)
There was a talk right after ours about LTO! I only half paid attention to it because I was catching up on the chat, but it sounds like Google is doing kernel LTO in prod for their internal systems (and maybe also for Android and CrOS?):

https://linuxplumbersconf.org/event/7/contributions/798/ (slide link at the bottom)

https://youtu.be/FFjV9f_Ub9o?t=3844

Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @05:05PM (#24335959)
At the moment, I believe the Linux kernel can do LTO with some additional patches, but there are still regular issues. It isn't nearly as well supported as Clang or LLD yet.
Re:Supporting Linux kernel development in Rust by danudey on Wednesday September 02, 2020 @02:51PM (#24356460)
ICYMI, Microsoft is putting a lot of eggs into the LTO/PGO basket to try to improve Linux performance: https://www.phoronix.com/scan.php?page=news_item&px=Microsof...
Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @04:47PM (#24335777)
Linux currently only compiles on GCC and Clang, and the latter is a recent development. rustc uses LLVM as a backend, just like Clang, and people are working on other backends. Linux maintainers didn't express any concerns about this being an issue.
Re:Supporting Linux kernel development in Rust by Silhouette on Monday August 31, 2020 @04:45PM (#24335753)
Would adding more and more dependence on rust mean that it ties the kernel to a single set of compilers?

Like GCC?

Your point is certainly valid, but I'm not sure it's a new problem.

Re:Supporting Linux kernel development in Rust by AquaLineSpirit on Monday August 31, 2020 @05:18PM (#24336066)
There is the mrustc compiler https://github.com/thepowersgang/mrustc

It's not fully complete. But there is no reason why it couldn't be.

Re:Supporting Linux kernel development in Rust by AquaLineSpirit on Monday August 31, 2020 @05:38PM (#24336199)
Also it would be kind of funny. Where the rust parts can only be compiled by the llvm based rust compiler, but clang(llvm) can't build the C parts. And gcc can only build the C parts but not the rust parts :)
Re:Supporting Linux kernel development in Rust by boogies on Monday August 31, 2020 @04:37PM (#24335682)
Mozilla’s trademark policies have been annoying enough in the past that Debian used to ship a fork with the branding stripped. Hyperbola continued this practice for a while, but stopped for a variety of reasons in the It’s Foss interview, and switched to a UXP-based browser. I’m writing this from a UXP-based browser because I find it much better than Firefox and I dislike Mozilla in general for more than one reason.

But no, there are other reasons outside of trademarks, some technical ones are in submisson’s article.

Re:Supporting Linux kernel development in Rust by Macha on Monday August 31, 2020 @04:42PM (#24335729)
The licensing complaints about Rust apply equally to Python, which they package without objection: https://www.hyperbola.info/packages/extra/x86_64/python/
Re:Supporting Linux kernel development in Rust by cylon13 on Monday August 31, 2020 @04:44PM (#24335745)
Not exactly: [0]

> Some users have correctly mentioned that many other software packages have trademarks, do we plan to remove them all? No. We are not against all trademarks, only those which explicitly prohibit normal use, patching, and modification.

> As an example, neither Python PSF nor Perl Trademarks currently prohibit patching the code without prior approval. They do prohibit abuse of their trademarks, e.g. you cannot create a company called “Python”, but this does not affect your ability to modify their free software and/or apply patches.

> Due to the anti-modification clause, Rust is a non-permissive trademark that violates user freedom.

[0] https://wiki.hyperbola.info/doku.php?id=en:main:rusts_freedo...

Re:Supporting Linux kernel development in Rust by jcranmer on Monday August 31, 2020 @05:08PM (#24335977)
I suspect whomever wrote that hasn't actually read the trademark policies in detail, or conferred with lawyers about it. Neither Python's nor Perl's agreements explicitly cover the case in detail, but Perl does mention this:

> Licensed redistributors of Perl code are permitted by their licenses to use the Perl logo in connection with their distribution services, on product packaging, and in promotional materials.

IANAL, but that text would especially suggest to me that you would have no right to use the trademark even to distribute an unmodified binary of Perl without approval.

I suspect the real reason is Debian and Mozilla had a very public, well-known spat over licensing, and Python and Perl have not had very public, well-known spats with anybody.

Re:Supporting Linux kernel development in Rust by Macha on Monday August 31, 2020 @04:45PM (#24335758)
Well, good luck calling your modified Python release Python: https://github.com/naftaliharris/tauthon/issues/47
Re:Supporting Linux kernel development in Rust by TylerE on Monday August 31, 2020 @04:28PM (#24335582)
I don’t see how that conplaint is at all meaningful to kernel development.

It’s typical GNU/Pendantry.

The kernel will not be shipping a rust compiler, patched or otherwise.

Re:Supporting Linux kernel development in Rust by boogies on Monday August 31, 2020 @04:31PM (#24335613)
The article mentions possible ABI compatibility challenges and I also think it’s not a good thing for a language in such critical applications to only have a single major implementation.
Re:Supporting Linux kernel development in Rust by eptcyka on Monday August 31, 2020 @04:35PM (#24335658)
The linux kernel still can only be compiled with GCC. Of course, it's a single patch away from clang compatibility, but the kernel has never been compilable with much else but GCC.
Re:Supporting Linux kernel development in Rust by pjmlp on Tuesday September 01, 2020 @04:02PM (#24346354)
Android and ChromeOS beg to differ, as Google has been using clang with them for at least around three years now.
Re:Supporting Linux kernel development in Rust by eptcyka on Wednesday September 02, 2020 @05:22AM (#24351423)
Yes, clang compatibility is a single patch away. Google, unlike the vast majority of companies out there, is capable of maintaining it's own forks of the kernel.
Re:Supporting Linux kernel development in Rust by ArchOversight on Monday August 31, 2020 @04:44PM (#24335752)
Once again the GPL camp takes and relicenses a project so that further improvements they make can't be used by the original authors.

Shame really.

Re:Supporting Linux kernel development in Rust by JetSetWilly on Tuesday September 01, 2020 @04:24AM (#24339623)
If they didn't want people to be able to make changes that cannot be used upstream, there's a license for that. It's called the GPL.
Re:Supporting Linux kernel development in Rust by boogies on Monday August 31, 2020 @05:25PM (#24336121)
They can be used by the original authors, if the original authors stop intentionally licensing their code so weakly that anyone can make changes that no one else can even see.
Re:Supporting Linux kernel development in Rust by badrabbit on Monday August 31, 2020 @04:34PM (#24335639)
Maybe a GNU Rust compiler without the trademark is in order? The state of KSPP is not nice as well. I wish Ada was more popular. From what I know, it has much of the security guarantees rust has and it has been battle tested.
Re:Supporting Linux kernel development in Rust by guerrilla on Monday August 31, 2020 @04:37PM (#24335674)
I'm not sure, but aren't they saying that they wouldn't be able to call it "GNU Rust" [1] in the same way they can't call IceCat "GNU Firefox"?

1. https://wiki.hyperbola.info/doku.php?id=en:main:rusts_freedo...

Re:Supporting Linux kernel development in Rust by ifmpx on Monday August 31, 2020 @09:28PM (#24337628)
Windows(R) subsystem for Linux(R), anyone?

GNU can either cut a deal with the Rust Foundation or use fair-use previsions afforded by trademark law. I think there is some leeway for cases like these.

Re:Supporting Linux kernel development in Rust by badrabbit on Monday August 31, 2020 @04:57PM (#24335857)
They can call it something else entirely. Rusty? Brown? Who cares so long as it is compatible with rustc
Re:Supporting Linux kernel development in Rust by steveklabnik on Monday August 31, 2020 @05:21PM (#24336092)
If it is compatible with rustc, then we would probably approve a request to use the trademark.
Re:Supporting Linux kernel development in Rust by badrabbit on Monday August 31, 2020 @06:12PM (#24336413)
They don't want to have to ask.
Re:Supporting Linux kernel development in Rust by steveklabnik on Monday August 31, 2020 @06:15PM (#24336436)
Yes, I understand that. Just trying to make it clear that the issue is with that itself, not on our side.
Re:Supporting Linux kernel development in Rust by homarp on Monday August 31, 2020 @04:53PM (#24335825)
well, plenty of names to play with:)

GNR: Gnr Not Rust

TRust: Treated Rust

...

Re:Supporting Linux kernel development in Rust by gpm on Monday August 31, 2020 @05:03PM (#24335928)
How do you pronounce GNR? It think it needs to be a vowel, or an R.

Some attempts: GRR: Gnu Renames Rust, GAR: Gnu assimilates rust, GER: Gnu non Est Rust (gnu is not rust, but in latin to get an E), GIR: Gnu Isn't Rust, GOR: Gnu Oxidizes Rust, GUR: Gnu Unseats Rust.

Re:Supporting Linux kernel development in Rust by homarp on Tuesday September 01, 2020 @01:19AM (#24338785)
pronounces it Gnar or Gener, depending if you are a gif or a jif person.

You can also go for GunsNRoses, but they won't like it and complain. Which might be good for visibility at the beginning.

Re:Supporting Linux kernel development in Rust by el_oni on Monday August 31, 2020 @05:17PM (#24336065)
Or something like "oxide", ferrite, maGNUtite. Play with iron ores or compounds
Re:Supporting Linux kernel development in Rust by homarp on Tuesday September 01, 2020 @01:21AM (#24338795)
oxide computing is taken... plus the name game around compound is tiring. I prefer to try rock bands.
Re:Supporting Linux kernel development in Rust by bitwize on Monday August 31, 2020 @04:49PM (#24335800)
I'd be more concerned about the fact that the Rust Evangelism Strike Force is hellbent on getting everybody to depend on their exhausts-all-32-bit-address-space-to-build compiler and toolchain -- in addition to whatever toolchain the project currently uses, at least as long as the strangler pattern is being applied to migrate the code base to 100% Rust. GNU software in particular has always been such that the core stuff is bootstrappable from just C.

But it seems, from an RESF standpoint, that the fact that any C code is out there running at all is a crisis-level problem.

Re:Supporting Linux kernel development in Rust by JoshTriplett on Monday August 31, 2020 @04:55PM (#24335839)
Standing reminder: the Rust project is not a fan of rabid Rust over-evangelism (e.g. "Rewrite It In Rust", "Rust Evangelism Strike Force"), and sees it as damaging and unhelpful. We discourage that kind of thing wherever we see it. We're much more in favor of a measured, cautious approach.