Live data from Hacker News

Supporting Linux kernel development in Rust

lwn.net

201–210 of 365 posts

Re: Supporting Linux kernel development in Rust

#201
post #27

One of the challenges to building an entirely new kernel is the vast amount of hardware support in the form of drivers and the features the existing kernel exports to userland in the form of syscalls. Would it be possible for a hypothetical new kernel, presumably written in Rust, to run an existing kernel such as Linux in a VM, just to tap into its drivers and emulate its syscalls? As more drivers are ported to the b…

I was thinking about something similar recently - if the hardware drivers could somehow be abstracted from the rest of the linux kernel (as if...), then suddenly a ton of experimental kernels could have widespread hardware availability. It would probably shake up the OS ecosystem to no small degree, but I imagine the fresh ideas that could be experimented with by non-experts would be hugely beneficial. Isn't that the…

Apple IOKit

Re: Supporting Linux kernel development in Rust

#202
post #105
post #89

Earlier quoted context omitted.

That's a front end?

Compile C to Rust! Easiest language migration ever.

It shares the code generator with gcc. It doesn't transpile C to Rust or vice versa. The goal is to produce machine code directly.

Re: Supporting Linux kernel development in Rust

#203

I'm concerned about the gradual move from GCC to LLVM. The lack of copyleft protections on LLVM means that it's much more dependent on corporate sponsorship, and means that there's a risk that major improvements to LLVM compilers will only become available as proprietary products. People underestimate the role of copyleft licenses in preserving long-running FOSS products like GCC, Linux, etc.

> I'm concerned about the gradual move from GCC to LLVM. The lack of copyleft protections on LLVM means that it's much more dependent on corporate sponsorship, and means that there's a risk that major improvements to LLVM compilers will only become available as proprietary products. As someone who works within LLVM professionally, I don't think this is particularly likely -- compilers are massive and complicated beas…

What if those bigcorps don't merge some improvements for getting an edge over the competitors? And, what if every one of those bigcorps do the same? How would that impact the project in the future?

Re: Supporting Linux kernel development in Rust

#204
Sounds like they have the same problem Apple's Swift does for calling into C/Obj-C.

Two examples: My understanding is that there's a ton of code and added complexity in Swift itself to support Obj-C interoperation. And while you can call C and Obj-C APIs, as-is, there was/is basically a company-wide effort to write API wrappers (aka. overlays) for existing system APIs.

For the second part, maybe if Rust for Linux kernel programming gets to the level of popularity as, say, TypeScript in the JavaScript community, the Linux community will end up creating the needed API wrappers as an organic, group effort.

Re: Supporting Linux kernel development in Rust

#205
post #191

Earlier quoted context omitted.

> they're sufficiently general and easiest to maintain by releasing back upstream (where Apple, Google, and Microsoft will pay a small army of compiler engineers to keep them working). ...keep them working for their use-cases .

> keep them working for their use-cases Are you under the impression that C and C++ code within Apple, Microsoft, and Google is fundamentally different from C and C++ code elsewhere? Because it isn’t. Google’s engineers maintain LLVM’s ASan for their purposes, but those purposes happen to be everybody else’s as well.

Right, the reality is that if you want to be a profitable tech company today, you have to leverage open source. "Their use cases" includes, like, everything in a Linux distro. (And yes, this applies to Apple and Microsoft as well as Google.)

The necessity of open source for industry has both negative and positive implications for those of us who care about open source / free software as an ideal and not simply a tool of capitalism. The negative one (which GCC's leadership failed to really internalize) is that the number of engineer-hours at the command of for-profit companies is much higher than the number of engineer-hours at the command of community-driven projects. If you deliberately build a worse product to prevent corporations from using it for profit, given enough time, the corporations will replace it. The positive one, though, is that those engineer-hours are generally more valuable when pointed at some common cross-company codebase unless it is the specific thing that makes you money, and FOSS as an ideal provides a well-accepted model under which they can organize cross-company work (doubly so when they employ idealists like us as implementors). A compiler makes very few people money directly. It's generally a tool that you want to work well, and it's helpful to have other people run into the majority of problems and fix them before they cause trouble for the things that do make money.

So it's not surprising that LLVM is catching up with GCC, nor is it surprising that LLVM is and remains open source. If you are concerned about the LLVM monoculture, build a competitor such that it is cheaper / more profitable for companies to work on your competitor than to either work on LLVM or build their own compiler. Figure out what will make companies want to contribute and encourage it. (GCC did not do this, but it is perhaps slowly relaxing here.) If you are concerned about LLVM becoming proprietary, make it so that is cheaper / more profitable for companies to release their changes instead of holding onto them; that is, figure out what will make companies feel like they must contribute and encourage it. (One common strategy, used by Linux itself, is to maintain a high level of internal API churn coupled with genuinely good improvements in that churn and a policy that people must update in-tree callers; at that point, the more API surface you use in your private fork, the farther behind you get, and you'll watch competing companies outpace you.)

Re: Supporting Linux kernel development in Rust

#206

Earlier quoted context omitted.

Most of the thriving non-GPL OSS projects are supported and funded by large corporate sponsors--not by communities or foundations (e.g. React.js by Facebook, Blink by Chrome). Furthermore, many non-GPL OSS projects have eventually gone proprietary (e.g. MongoDB's switch from AGPL to SSPL).

Are the thriving GPL’d projects not also sponsored by corporations - who fund the foundations and whose employees contribute the most code?

Linux? Python?

Re: Supporting Linux kernel development in Rust

#207

Earlier quoted context omitted.

Most of the thriving non-GPL OSS projects are supported and funded by large corporate sponsors--not by communities or foundations (e.g. React.js by Facebook, Blink by Chrome). Furthermore, many non-GPL OSS projects have eventually gone proprietary (e.g. MongoDB's switch from AGPL to SSPL).

Are the thriving GPL’d projects not also sponsored by corporations - who fund the foundations and whose employees contribute the most code?

Those GPL'd(eg. GCC, Linux) projects predate their current corporate sponsors. The sponsors may go away anytime if they feel the project won't add any business value for them. I highly suspect if they would sponsor support any new GPL project.

Re: Supporting Linux kernel development in Rust

#208
post #39
post #31

Earlier quoted context omitted.

well, plenty of names to play with:) GNR: Gnr Not Rust TRust: Treated Rust ...

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.

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

#209
post #54
post #31

Earlier quoted context omitted.

well, plenty of names to play with:) GNR: Gnr Not Rust TRust: Treated Rust ...

Or something like "oxide", ferrite, maGNUtite. Play with iron ores or compounds

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

#210
post #105
post #89

Earlier quoted context omitted.

That's a front end?

Compile C to Rust! Easiest language migration ever.

That would eliminate the need for Rust. Just imagine, if your C code can be converted into Rust, would there ever be a case to start a fresh project in Rust? It will permanently become an Intermediate language.
Post reply on HN