Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Operating Systems Programming Security Linux

RISC-V Now Supports Rust In the Linux Kernel (phoronix.com) 31

Michael Larabel reports via Phoronix: The latest RISC-V port updates have been merged for the in-development Linux 6.10 kernel. Most notable with today's RISC-V merge to Linux 6.10 is now supporting the Rust programming language within the Linux kernel. RISC-V joins the likes of x86_64, LoongArch, and ARM64 already supporting the use of the in-kernel Rust language support. The use of Rust within the mainline Linux kernel is still rather limited with just a few basic drivers so far and a lot of infrastructure work taking place, but there are a number of new drivers and other subsystem support on the horizon. RISC-V now supporting Rust within the Linux kernel will become more important moving forward.

The RISC-V updates for Linux 6.10 also add byte/half-word compare-and-exchange, support for Zihintpause within hwprobe, a PR_RISCV_SET_ICACHE_FLUSH_CTX prctl(), and support for lockless lockrefs. More details on these RISC-V updates for Linux 6.10 via this Git merge.

This discussion has been archived. No new comments can be posted.

RISC-V Now Supports Rust In the Linux Kernel

Comments Filter:
  • Rust is rubbish?? (Score:1, Interesting)

    by Anonymous Coward
    I can appreciate the zealotry for doing everything in Rust, it's a religion. Rust solves a couple of common issues but at what cost? Writing memory safe C isn't that difficult for a competent programmer. It just takes attention to and care with the details. C also runs far more efficiently. Still, the zealots are true believers and Rust can do no wrong. If you want a completely safe programming language, pick Algol-60. I've never found any problems with any implementation I've used. A completely "sa
    • I have read that they can't really even come up with great gui libraries for rust because it forbids mutable tree structures, which is basically what a gui is.
      • I'm pretty sure that's not true. Admittedly I don't know Rust, but from what I've read, it does support mutable tree structures. In fact, if I understand correctly, its memory safety is basically all about mutable tree structures. I think its limitation is essentially that it only supports tree structures. So you can't have doubly-linked lists, or directed acyclic graphs (other than trees), or things like that.
        • That sounds pretty limiting. You shouldn't have to fight the language.
          • I can see why you'd think that, but, apparently, for many use cases, trees are all you need. Rust has been rated "most loved" programming language in the Stack Overflow developer survey for 8 years in a row, where "most loved" is defined as the language with the highest proportion of current users who want to continue using it, I think. So it seems that people find the benefit of memory safety without garbage collection to be worth the cost of only using trees.
            • Trees are very limited. Look at the tangled mess that ldap or active directory has become in medium to large organizations. Sure, binary trees are great in development but there are so many other more efficient options. Linked lists and doubly linked lists are also limited. It seems with AI becoming so hyped, absolute flexibility in data structure design is paramount. It's not that everything will need it. I have used bubble sort for lists of 20 things, but that would be a frustrating way to design th
        • You can use Rc (referenced counted smart pointer) or Arc (same, but atomic access for cross thread) for doubly linked lists, I think. But then, I'm only a few months into learning Rust.

      • Based on this [rust-lang.org], I might say that too. Parenthetically, the frequent use of exclamation points is bothersome to me. "See! See how cool?!'' is the message of that to me. I see limitation without benefits, a manger's coding dream for a business that churns employees maybe. Très moderne.
    • It just takes attention to and care with the details.

      That can be a problem (even the problem), especially if you're on the clock...

    • Rust In the Linux Kernel

      I thought the kernel was looking a little corroded. Nothing that a little "C"lr can't fix.

    • Writing memory safe C isn't that difficult for a competent programmer.

      Incompetent programmers are cheaper.

    • Writing memory safe C isn't that difficult for a competent programmer.

      The wreckage of the last 50 years of computing history demonstrates that assertion to be completely false for any realistic definition of "competent programmer".

      In principle, any C program could be written without memory bugs, just like in principle all NP-complete problems have a solution. That doesn't mean that you could actually do either thing in the real world.

    • by jythie ( 914043 )
      Rust is an ok language, but has a terrible community. What do you expect from a language where the only real utility it has is people knowing that OTHER programmers are doing things their way, and thus they can filter the 'wrong kinds of people' out of their community.

      Really creepy bunch.
    • by flux ( 5274 )

      > Writing memory safe C isn't that difficult for a competent programmer. It just takes attention to and care with the details.

      "There's nothing that can be made about improving memory safety, say developers using the programming language with the most memory safety issues."

      Memory safety is hardly the only thing Rust has going for it, though.

      It also has a pretty nice type system with ML-like algebraic data types (with the surprisingly accurate trite "make invalid state inexpressible") and traits, the com

  • RISC-V is a processor architecture.
    Since when does a processor architecture support a specific programming language?

    It is the other way around.
    The Rust compiler can compile to RISC-V.
    And it can be done for kernel code, what ever there is special about that ...

    • RISC-V is also a an arch build target, and it's perfectly reasonable to say that a target platform in a build system supports such and such

      • by twdorris ( 29395 )

        RISC-V is also a an arch build target, and it's perfectly reasonable to say that a target platform in a build system supports such and such

        Sure, sure. We get it. But then just *say* "Rust target added for RISC-V kernel builds". Or *something* that isn't so completely bass-ackwards.

        • by SirSlud ( 67381 )

          Sure, sure. We get it.

          Yes, any person for whom this information is relevant for gets it and understands it perfectly fine. So who other than somebody who is desperate to feel like they have something "useful" to say in the absence of anything else gives a fuck?

          Nobody, that's who.

    • I read it as "RISC-V (target) now supports rust in the kernel"

      And from what I understand (which admittedly is barely enough to follow along) kernel rust (and C/C++) IS special. Something to do with how kernel stack/heap allocation works and so you can't use everything in the language or the standard libraries which will assume a userspace model that's incompatible. But that's the limit of what I "know" so google will have to be your friend.

    • Normal non-autistic people write like this.

      > Since when does a processor architecture support a specific programming language?

      It is trival to conclude for most readers that what they're talking about is the community supporting the RISC-V architecture in the linux kernel.

      Gaslighting grammar nazis might also feign confusion but they mostly left for Facebook.

      We should recognize that this site might benefit from accessible writing in submissions.

    • Since when does a processor architecture support a specific programming language?

      What kind of terrible interpretation is this? The title and summary state that this is for "kernel development" specific to a processor.

      And it can be done for kernel code, what ever there is special about that ...

      Yes because any language can be compiled for the Linux kernel. Just the other day, I was compiling COBOL to make a Linux kernel . . . oh wait I meant C11. It is like Linux kernel code can only be certain languages like C11 and now Rust.

      • Yes because any language can be compiled for the Linux kernel.
        That is exactly what I said ...
        No idea about your point.

    • First line of the summary: "The latest RISC-V port..."

      The headline writer seemingly thought the word "port" was unnecessary or redundant. That's its own problem.

  • by ArchieBunker ( 132337 ) on Thursday May 23, 2024 @09:37AM (#64493403)

    Is there a powerful enough RISCV system to compile rust natively?

  • "Risk is good..." Crash Override 1995

  • If RISC V wants adoption they need to add floating point instructions. The FAUST project did all the work and did the VHDL - why can't we find it in a commercial offering???

    As it stands, RISC V remains a microcontroller! And not the best value one either!

"Because he's a character who's looking for his own identity, [He-Man is] an interesting role for an actor." -- Dolph Lundgren, "actor"

Working...