Announcement

Collapse
No announcement yet.

Linux Developers May Discuss Allowing Rust Code Within The Kernel

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

  • #91
    Originally posted by inout View Post

    LOL. looks like the fuschia gang shooed him away !
    What are you talking about?

    Comment


    • #92
      Originally posted by oleid View Post

      Depends. If you restrict the new language to satellite code like drivers introducing a new language is not very invasive. Also, it might make the kernel-internal driver API more stable.



      Different projects by different people. Some people are qualified to work on kernel code, others on GUI toolkits.



      As far as I know, there are currently no plans to - say - rewrite GTK+. It might not make much sense, anyway, since there is shared state everywhere in existing GUI toolkits and that is - for good reason - unergonomic to work with in rust. E.g. one would need to use RefCells to do the borrow checking at runtime.

      That being said, there are totally new toolkits in the works experimenting with idiomatic (as in: a different software architecture) ways for creating GUI toolkins in a thread-safe way. Just to name a few.

      The Rust UI-Toolkit. Contribute to redox-os/orbtk development by creating an account on GitHub.

      A data-first Rust-native UI design toolkit. . Contribute to linebender/druid development by creating an account on GitHub.



      I've already worked a little with druid and I find it quite nice. Granted, they are not battle tested, yet(*). But considering the battles I've already fought with Qt5 in the context of shared state and OpenGL rendering (doesn't crash in one Qt version, crashes in the other) I wonder what battle tested actually means.

      (*) OrbTK is the GUI toolkit for Redox-OS and it would seem druid is used for a font editor called Runebender sponsored by Google Fonts.
      Thanks, very insightful. I do think the way to build GUI app should be made nicer and easier (less error prone). Rust certainly could help here.

      Comment


      • #93
        Originally posted by Almindor View Post
        I think you need to take this more like an evolution. If the Linux kernel stays in C it will eventually be left behind and replaced by something implemented in a more safe language that can provide the same (or even better) performance but with more safety guaranteed.
        I understand,
        But I don't know if Rust is a evolution..
        The syntax of the language seems very weird to me,
        And I don't know either about type safety, it seems a pipe dream to me, apart from the fact that, there are code that at compile time does seem to have memory leaks, or NULL Pointers that will be dereferenced later, but when the code runs everything runs fine, without leaks or NULL pointers, etc..

        Besides C is a language that is very simple, and its simplicity is awesome, I don't know about any real substitution to it..

        I am afraid that adding a new language will turn the Linux Kernel in a Frankenstein thing..

        Comment


        • #94
          Originally posted by tuxd3v View Post

          The syntax of the language seems very weird to me,
          Absolutely. However if you come from a C++ background where you have been using templates, RAII and memory safe concepts (such as smart-pointers) for a while, it actually is very familiar.

          The only real difference we need to put on top is "mut" (which is basically propagate_const<T> in a nicer form) and replacing exception use with template return types.
          The rest of the stuff (i.e the really important borrow checker) generally comes for free.

          The only issue I have is faffing with Cargo offline. I will never connect a development workstation to the internet and Cargo really isn't geared up for this kind of isolated use. At the moment I just mirror the entirety of crates.io and distfiles but this is not really a solution for everyone. Luckily Rust in the kernel will likely not depend on Cargo so problem averted.
          Last edited by kpedersen; 13 July 2020, 09:37 AM.

          Comment


          • #95
            Originally posted by tuxd3v View Post
            I understand,
            But I don't know if Rust is a evolution..
            The syntax of the language seems very weird to me,
            And I don't know either about type safety, it seems a pipe dream to me, apart from the fact that, there are code that at compile time does seem to have memory leaks, or NULL Pointers that will be dereferenced later, but when the code runs everything runs fine, without leaks or NULL pointers, etc..

            Besides C is a language that is very simple, and its simplicity is awesome, I don't know about any real substitution to it..

            I am afraid that adding a new language will turn the Linux Kernel in a Frankenstein thing..
            Safe rust guarantees no leaks. That doesn't mean tho that it's impossible to write a program to "keep a lot of memory needlessly" on the heap for example for the duration of the whole program and only free it at the very end. It's not a technical leak but it's still a practical leak. That is of course not solvable via a language, but that much should be obvious.

            I think the best "oooh" moment for me when I started to play with Rust and embedded systems was when it saved me from shorting a pin by compile time checks (because the Pin structure was designed in such a way to prevent reusing the same physical pin twice by accident). That was my "this is it" moment.

            I definitely wouldn't use Rust for some tasks but embedded, systems/kernel programming, drivers and some back-end stuff is where I think it brings SO much to the table it'd be crime not to use it.

            Comment


            • #96
              Same picture as thousand times before. Same mantras, same paid clowns on the stage. If language with such unreadable syntax is not enough, the implementation is miserable pile of hipster shit. "systems" language developed by people who have no idea of proper bootstrapping, cross compiling and reproducible builds. Also, downloading random crap from the Internet during build process. It will get a middle finger from Linus. He is a sane person. Carefully weighting switch to gcc 4.9 and then allowing rust. Yeah, good luck.

              Comment


              • #97
                Originally posted by jjkk View Post
                "systems" language developed by people who have no idea of proper bootstrapping
                Want to show some of your own examples of how a self-hosting compiler should approach bootstrapping? GCC isn't exactly a paragon of ease for bootstrapping from non-GCC C compilers.

                Originally posted by jjkk View Post
                Also, downloading random crap from the Internet during build process.
                First, if they do use Cargo, there's cargo vendor and cargo build --offline. Second, I doubt they'll be using Cargo and rustc doesn't download stuff from the Internet if you integrate it into some other build system directly.

                Comment

                Working...
                X