• JakenVeina@lemm.ee
    link
    fedilink
    English
    arrow-up
    25
    arrow-down
    1
    ·
    7 days ago

    If only it were that easy to snap your fingers and magically transform your code base from C to Rust. Spoiler alert: It’s not.

    How utterly disingenuous. That’s not what the CISA recommendation says, at all.

  • tourist@lemmy.world
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    7 days ago

    My friend from university sends me his Rust code snippets sometimes. Ngl it looks like a pretty cool language.

    There was also that tldr reimplemention in Rust that is a gatrillion times faster than the original.

    I really want to give it a try but I have executive dysfunction and don’t have any ideas of what I could use it for.

  • thingsiplay@beehaw.org
    link
    fedilink
    arrow-up
    42
    arrow-down
    1
    ·
    7 days ago

    But there is context to it:

    The report on Product Security Bad Practices warns software manufacturers about developing “new product lines for use in **service of critical infrastructure or [national critical functions] **NCFs in a memory-unsafe language (eg, C or C++) where there are readily available alternative memory-safe languages that could be used is dangerous and significantly elevates risk to national security, national economic security, and national public health and safety.”

    It’s for new products that are very important to critical infrastructure and need to be safe as possible. The article writer seem not to be aware of this context:

    Take Rust in Linux, for example. Even with support from Linux’s creator, Linus Torvalds, Rust is moving into Linux at a snail’s pace.

    Because Linux is the biggest software in the entire world and they do lot of stuff their own way. Rust is integrated slowly for future new projects. It makes sense to move in snail pace. The government doesn’t suggest the Linux project to stop using C entirely. The government “recommends” to start new projects in memory safe languages, if it is a critical software. That makes sense to me.

    You see, people who’ve spent years and sometimes decades mastering C don’t want to master the very different Rust. They don’t see the point.

    No, totally wrong. C programmers in Linux do not NEED to learn or master Rust. They just need to cooperate. The problem is, that some C programmers refuse to cooperate with Rust. They just want Rust to disappear. That has nothing to do with mastering the language. They refuse to make changes to their C code, so it can cooperate with Rust code via bindings.

    After all, they can write memory-safe code in C, so why can’t you?

    Nonsense argument, and false too. If that was the case, why do we have memory safe languages? Clearly people make mistake, old and new. Besides Linux is not the only software in the world.

    Converting existing large codebases to memory-safe languages can be an enormous undertaking.

    Nobody says old code should be rewritten in Rust. Neither the government, nor the Rust programmers in Linux suggest that. It’s not about rewriting code in memory-safe languages, its about new projects.

    Either this article is a misrepresentation or misunderstanding. Or I misunderstand the article or government. I don’t know anymore…

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      19
      ·
      7 days ago

      They refuse to make changes to their C code, so it can cooperate with Rust code via bindings.

      I don’t even think the rust devs where asking for that. They are refusing changes by rust devs that help with rust while making the c code clearer and even refuse to answer questions about the semantics behind the c code. At least as far as I can see from the outside.

      • wewbull@feddit.uk
        link
        fedilink
        English
        arrow-up
        6
        arrow-down
        5
        ·
        7 days ago

        The Rust kernel devs are …

        1. …asking the maintainers to lock down APIs which the C devs purposefully leave malleable, in part, to avoid binary blob drivers being feasible.
        2. …asking maintainers to accept code into their subsystem whilst being told, you don’t need to know Rust to an expert level…trust us. Cross language interfaces always have nuance and make good attack vectors. Understandable that maintainers are cautious.
        3. …creating quite a lot of hassle for no a lot of improvement. Systems are only as resilient as their weakest components. The cross language interface is always going to be weak. Introducing a weakness to get improvements probably only succeeds at making the whole weaker.
        • lad@programming.dev
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 days ago

          What’s the reason to avoid binary blob drivers being feasible? Is that about not being able to use non-free binary blobs in kernel? I don’t quite understand what it even is about

        • refalo@programming.dev
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          7 days ago

          IIRC They were also trying to get kernel devs to let official structure definitions live in Rust instead of C, and got upset when they didn’t want to do that.

  • it_depends_man@lemmy.world
    link
    fedilink
    Deutsch
    arrow-up
    17
    arrow-down
    1
    ·
    7 days ago

    To address this concern, CISA recommends that developers transition to memory-safe programming languages such as Rust, Java, C#, Go, Python, and Swift.

    If only it were that easy to snap your fingers and magically transform your code base from C to Rust.

    guy_butterfly_meme.jpg is this unbiased journalism?

    • Successful_Try543@feddit.org
      link
      fedilink
      arrow-up
      6
      arrow-down
      4
      ·
      edit-2
      7 days ago

      As the article is denoted as a comment, it is not its aim to be unbiased journalism.

      In contrast to usual articles, comments usually elaborate on the opinion of the jounalist.

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    4
    arrow-down
    15
    ·
    edit-2
    7 days ago

    Eventually, painfully, slowly, we’ll move to memory-safe languages. It really is a good idea. Personally, though, I don’t expect it to happen this decade. In the 2030s? Yes, 2020s? No.

    This. Unless the government starts introducing fines or financial incentives (like fines) to force the use of memory-safe languages, ain’t nothing gonna happen.

    Anti Commercial-AI license

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      7 days ago

      AFAIK, the first one was written in LISP.

      The one most people push around here was written in Rust. It’s a really great language to write memory managers anyway.

    • De_Narm@lemmy.world
      link
      fedilink
      arrow-up
      24
      arrow-down
      1
      ·
      edit-2
      7 days ago

      Who cares? Just like most things your average programmer relies on, they are written by smarter or at least more specialised people to make your job easier. They have learned to write memory-safe code so you don’t have to.

      • Takumidesh@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        7 days ago

        More specialized is critical.

        You have to understand your domain, what your goal is, how much time and money you have, etc.

    • atzanteol@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      15
      arrow-down
      1
      ·
      7 days ago

      God, this old argument… Careful, it’s an antique.

      The idea is to minimize memory management and have people who are experts on it deal with it.

    • Mihies@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      7 days ago

      I don’t think those are the problem, but rather how they are used. And in case of managed languages like C#, it’s almost impossible to shoot yourself in the foot when it comes to memory management. You still can, if you really wish, but you have to be very explicit in that. 🤷‍♂️