Live data from Hacker News

Supporting Linux kernel development in Rust

lwn.net

231–240 of 365 posts

Re: Supporting Linux kernel development in Rust

#231

Earlier quoted context omitted.

I am even more concerned about LLVM monoculture. LLVM is just a proprietary-able version of GCC. And thus compiler authors mostly focus on benchmarks while not caring about other metrics such as compilation speed, correctness and codebase quality / ease of contribution. There appears to be some tribal knowledge requirement to add a new target. With all the hype and apple funding LLVM gets, it could have been better.

I all see are a bunch of baseless accusations.

[deleted]

Re: Supporting Linux kernel development in Rust

#232

Earlier quoted context omitted.

I am even more concerned about LLVM monoculture. LLVM is just a proprietary-able version of GCC. And thus compiler authors mostly focus on benchmarks while not caring about other metrics such as compilation speed, correctness and codebase quality / ease of contribution. There appears to be some tribal knowledge requirement to add a new target. With all the hype and apple funding LLVM gets, it could have been better.

I all see are a bunch of baseless accusations.

[deleted]

Re: Supporting Linux kernel development in Rust

#233
post #224

Earlier quoted context omitted.

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?

Already the case for Apple LLVM which has optimizations for Apple Silicon not upstreamed and never will be upstreamed.

Source?

Re: Supporting Linux kernel development in Rust

#234

Earlier quoted context omitted.

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.

Converting C to Rust is not that hard. Converting C to safe Rust is the difficult part.

Rust without safety isn't Rust at all!

Re: Supporting Linux kernel development in Rust

#235
post #225

Earlier quoted context omitted.

All of those frontends live inside the GCC source tree. Which requires copyright assignment to contribute to. And for a long time, it was difficult to "casually contribute" to GCC; you had to work towards "commit access", and it wasn't anyone's job to review other people's patches, so often it just didn't happen. And there are various other barriers to contribution as well. LLVM's license was certainly a factor, and…

No they do not. GNU Pascal, Modula-2, Modula-3, BASIC and plenty of OEM derived ones were never part of GCC source tree. I had to study GIMPLE and GCC integration as part of my compiler design studies back in the 90's, using those nice Walnut Creek CD-ROMs.

Sure, you could also fork all of GCC as part of your frontend. That's still a massive undertaking compared to a framework that's designed to be used as a library.

Re: Supporting Linux kernel development in Rust

#236
post #214

Earlier quoted context omitted.

> 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.

It may not be fundamentally different but it may only use a subset of features (e.g., no exceptions in C++ code) and/or target a subset of platforms. Without pointing fingers, I am sitting on (what looks to be) a codegen bug in Clang that is not of a high priority I am pretty sure due to the above reasons. This is not to say that I am not appreciative of all the work Google/Apple/etc engineers do in LLVM (I will be e…

I don't see how GCC (or copyleft in general) would help here. If they don't do the work cause they don't need it there's nothing to release.

Re: Supporting Linux kernel development in Rust

#237
post #230

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 ker…

Not even remotely as difficult as Swift. Rust can call into C at any time. It is ABI compatible and has no VM

The same is true of Swift, and Swift can also call into C whenever it likes. The difference is that Swift can do the same for Objective-C at full fidelity, including support the full Objective-C feature set (ARC, arbitrary selectors, interfaces, properties, you name it).

Re: Supporting Linux kernel development in Rust

#238
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…

> FreeBSD might be a better target though, since that's specifically designed to be compatible with everything.

NetBSD, perhaps, would be a better choice for "tries to run everywhere"?

Re: Supporting Linux kernel development in Rust

#239

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).

The gpl projects are also corporately sponsored, just indirectly.

A fair amount of GPL work is done by researchers in public universities

Re: Supporting Linux kernel development in Rust

#240
post #216

Earlier quoted context omitted.

> 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…

I don't consider the improvements that ARM, Apple, Sony, CodePlay, NVidia, AMD, among others, don't upstream due to IP considerations or revealing of hardware secrets, niche.

But if they have IP considerations or trade secrets to protect, they wouldn't contribute them to any other open source project either. This way, they can at least upstream everything, which doesn't fall under these restrictions.
Post reply on HN