Announcement

Collapse
No announcement yet.

Rust For Linux Kernel v9 Patches Trim Things Down Greatly For Easier Upstreaming

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Volta
    replied
    Originally posted by Sergey Podobry View Post
    Just implement a C++ library for the Linux with async and threading. It doesn't matter whether functionality is built-in in the language or exists as a library - someone need to implement it anyways.
    There will be no c++ crap in the kernel if you didn't notice yet.

    Leave a comment:


  • kpedersen
    replied
    Originally posted by NobodyXu View Post

    Why excludes references and RAII?
    These two features does not obfuscate the logic like exceptions and are both zero-cost abstraction.
    I agree with references. But RAII does hide a fair amount of implementation.
    I am mainly just going by what subsets of C++ others use. For example MISRA.

    Leave a comment:


  • NobodyXu
    replied
    Originally posted by kpedersen View Post

    I said "core useful parts". Gonna have to strip a lot more out than just STL

    In kernel land, that will mean stripping exceptions, RTTI. Probably also excluding the use of references and RAII. Its usage will end up even being closer to C99, than K&R C is to C99.
    Why excludes references and RAII?
    These two features does not obfuscate the logic like exceptions and are both zero-cost abstraction.

    Leave a comment:


  • kpedersen
    replied
    Originally posted by cj.wijtmans View Post

    Thats the biggest load of bs i ever heard. C++ without STL is nothing like C whatsoever.
    I said "core useful parts". Gonna have to strip a lot more out than just STL

    In kernel land, that will mean stripping exceptions, RTTI. Probably also excluding the use of references and RAII. Its usage will end up even being closer to C99, than K&R C is to C99.

    Leave a comment:


  • jacob
    replied
    Originally posted by Developer12 View Post
    It is astounding how many people in the comments here have no idea what's going on.
    It's the Denning-Krueger Effect in action.

    Leave a comment:


  • jacob
    replied
    Originally posted by kpedersen View Post

    Indeed. Rust would have failed very hard back then. But now Linus has commercial companies to keep happy.
    Rust didn't exist back then. Today Linus has his users to keep happy just like back then, and just like back then, he's being pragmatic, not ideological. On a side note, of course he must make commercial companies happy. And I'm very happy that it's the case. I want FOSS to be used for real production use cases.

    Leave a comment:


  • Sergey Podobry
    replied
    Originally posted by Developer12 View Post
    As for C++, someone was right to point out that C++ doesn't offer much when you strip it down. Fundamentally, there are no advantages to the kernel over C, other than a bunch of ways to make prefabbed bullshit.
    I bet you don't have much experience with C++. It's way more better and safer than C while maintain the same low level features and zero cost abstractions.

    Leave a comment:


  • Sergey Podobry
    replied
    Originally posted by piotrj3 View Post
    Also that is not all, for example Rust async is quite stable and doesn't require any imports and async boilerplate for kernel already does exist to use it right.

    in C++ you have to make imports for that, that are likely to not work in kernel.
    Just implement a C++ library for the Linux with async and threading. It doesn't matter whether functionality is built-in in the language or exists as a library - someone need to implement it anyways.

    Leave a comment:


  • Developer12
    replied
    It is astounding how many people in the comments here have no idea what's going on.

    This stripped down patch series isn't supposed to be the final word. In fact, I'm surprised it's even possible to compile a kernel module with it. The point of separating things out like this is simply to make a smaller patch series that's easier for reviewers to read over the next week. Then they'll probably come back with another chunk of the full patch series each kernel cycle until the whole thing is merged. That's how RT has finally made it into the mainline after all. Not in one big gulp but instead as a series of incremental parts.

    As for C++, someone was right to point out that C++ doesn't offer much when you strip it down. Fundamentally, there are no advantages to the kernel over C, other than a bunch of ways to make prefabbed bullshit. Rust code on the other hand, even when so feature-deprived as to be nearly useless, is still provably safe. The language contains no undefined behavior. Once the basic cruft for building rust code is merged, it's merely a matter of adding back in bindings for each kernel subsystem and whatnot so that people can implement the crap they actually want to use it for.

    Leave a comment:


  • piotrj3
    replied
    Originally posted by cj.wijtmans View Post

    Thats the biggest load of bs i ever heard. C++ without STL is nothing like C whatsoever.

    i think what others said hits the mark better its to keep google facebook or whatever happy. Money is the root of evil.
    It is not just STL, it is std too and stuff like boost because they are most of time not made in mind that allocation of memory in kernel is done using diffrent functions.

    When you strip C++ and Rust out of standard libraries, C++ offers some features that are not sufficient enough to add entire new language.

    Rust actually does offer some features that are hard to pass by like memory safety, good multithreading. This is primary reason why companies (and Linus too) are accepting Rust or embracing it - because removing risk from software is something you should do.

    Also that is not all, for example Rust async is quite stable and doesn't require any imports and async boilerplate for kernel already does exist to use it right.

    in C++ you have to make imports for that, that are likely to not work in kernel. If they don't work in kernel that means you need to implement entire coroutines by yourself which means you reinvent the wheel what could be done in C as well somehow. And even if coroutines import somehow would work its support by compilers is wacky.
    Last edited by piotrj3; 05 August 2022, 07:59 PM.

    Leave a comment:

Working...
X