• polite_cat@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    12 hours ago

    A type of person whos apartment would be a mess cause they never collect their garbage, but they have a good memory where they put things and what they need, so it is never a problem.

  • Zacryon@feddit.org
    link
    fedilink
    arrow-up
    11
    ·
    14 hours ago

    It’s for people who suffer from severe anxiety when they see stuff like: -> or * for example. /j

  • Agent641@lemmy.world
    link
    fedilink
    arrow-up
    39
    ·
    22 hours ago

    It’s a survival crafting game where players help each other survive the world with mutual cooperation, kind words and absolutely no Nazi or racist behaviour.

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    98
    ·
    1 day ago

    Actual answer:

    Rust is a relatively new programming language. Similar to C or C++ it compiles directly into executable binary code so it can be used for bare metal or low level operating system programming. It is thus relevant to Linux kernel development as things like drivers can and are being developed in Rust.

    Compare this to the likes of Java or C# which get compiled to bytecode or a kind of pseudo machine code that gets run in a virtual machine, which has advantages for application development, or something like Python which is interpreted (or just-in-time compiled) at run-time, useful as an end user scripting language.

    Rust is designed from the ground up to tackle some modern problems, a key one being memory safety. It’s a lot more paranoid about memory allocation and access and it’s structured around this. Older languages like C allow the programmer a lot more absolute control over the hardware, which effectively means the C programmer has a lot more footguns in his toolbox. Theoretically, Rust offers fewer opportunities for the developer to shoot himself in the foot.

    Rust also comes with some really cool tooling. Compiler errors usually point straight at the problem and say something like “Shouldn’t there be a colon here?” The build system, called Cargo, is really slick in a lot of ways, handling linking, compiling, even library package management in a very automatic fashion. It’s real slick to work with.

    As with anything, fans of the language can be a bit much; they stereotypically suggest rewriting everything under the sun in Rust whether it makes sense or not, and this includes the Linux kernel, which has caused some friction in the community; Linux contributors are often very accustomed to C and some don’t want to deal with anything else.

    • Bazoogle@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      5 hours ago

      I listen to Steve Gibson’s podcast “Security Now” and he was talking about why, for security reasons, memory safe applications should be the way of the future. So many security vulnerabilities come from improper memory management. And while C may be more powerful, giving up some of that power for standardization is almost always worth it. We could make much more progress if we were spending less time trying to make sure the memory is handling correctly in every situation. So while there is no doubt the crazy fans of it, I think moving to memory safe languages in general should be the way of the future.

      Of course, he still writes all his programs in assembly and refuses to learn anything else. But when you’re at his age, I guess you get a pass XD

    • Bogus007@lemm.ee
      link
      fedilink
      arrow-up
      14
      ·
      1 day ago

      I like the description by a Finn who said: Rust is like a car with automatic, while in C (or Zig) you need to change the gears. In Rust you literally follow the compiler, which allows many young developers to program at low level, while C demands more time to avoid bugs. It is up to each person what he/she prefers. I would prefer to control myself the stuff and learn the in and outs of memory management.

      • itslilith@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        18
        ·
        1 day ago

        It’s fair to want to learn (and it’s certainly a good skill to have), but the question is what you’d rather see in a large, production environment. Guard rails are usually there for a reason. As for the control: you actually can program memory-unsafe (and in kernel development you often have to!) in Rust. The difference is that in Rust it’s explicitly marked by an unsafe block:

        unsafe {
          ...
        }
        

        That way you get the same, fine-grained control over low-level processes, but someone else reading your code can at a glace spot where potential memory bugs may be.

        In the end, languages are a tool. Especially for personal projects, everyone should just go with what’s fun to them. I personally think it makes sense, logistically, to slowly transition legacy C-based projects to Rust, because it makes onboarding new developers easier, while keeping the same memory safety that requires years of experience otherwise, basically for free. But there’s really no rush to rewrite anything that’s working well in Rust

        • Bogus007@lemm.ee
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          Alas, when there is no difference between unsafe wrapper in Rust and C, then why learning Rust, if one wants to go for managing the memory manually? Especially when considering the complex way of coding in Rust? Another problem: going the easy way and forgetting the tricky parts - if Rust allows for unsafe code, but it is safer to put it into a « safe » mode, so why I need to take the burden and deal with unsafe code? This will evidently lead to the situation that less and less unsafe blocks will be used, which finally leads to a situation where the programmer forgets the in and outs of manual memory management. You can see it as the principal aim of writing memory safe code, but to me it is also a way of « delearning » by learning. I see here the reason why so many young programmers are opting for Rust, because manually managing the memory in larger projects like in C is a question of knowledge and experience which does not come in one day. I also doubt that following just the compiler is a good approach. I agree totally with your last points though! Coding should mean to have fun and be the same time mentally challenged due to complex algorithms or demand for better code in general.

          • Flipper@feddit.org
            link
            fedilink
            arrow-up
            7
            ·
            17 hours ago

            The difference is, you put up a sign “here be dragons” with unsafe. Certain operations break the garanties of rust, like pointer operations and Cells. So now you need to write a wrapper which upholds checks that they are not violated. If it breaks, you just need to check your unsafe code, instead of everything. Now only one person needs to deal with unsafe for everyone in a team to benefit.

            Memory safety isn’t a skill issue. There is a reason they happen in all big projects like android or chrome and only reduced when introducing safe languages.

            I’d rather have a compiler that tells me why my code was refused than a compiler which prints 100 lines of templates. Or a compiler, which tells me a pointer/reference is null instead of a compiler that knows, but it’s UB-NDR so it isn’t snitching. If the compiler tells me, hey here you could have a race condition, it’s one less bug I have to find with a debugger. A compiler that complains about uninitiated variables, instead of a compiler that gives me potluck as content.

            • Bogus007@lemm.ee
              link
              fedilink
              arrow-up
              2
              ·
              11 hours ago

              Thank you for your explanation and I understand it well, as well the advantage to find bugs quicker (which however does not mean that a safe code cannot be also a bad code). However, I do think that writing safe code without being guided by a compiler is indeed a skill. And the question how safe the code written with the help of the compiler will be is another interesting one. Perhaps we will find out in the future.

              In my opinion, Rust is a language dictated by the compiler rather than one that allows you to use your brain, knowledge, and skills to deepen your understanding. Rust is essentially a programming language with training wheels. Unfortunately, the preference to finish tasks quickly is nowadays the mainstream. The understanding of the deeper stuff falls behind.

              A related example from real life: bike tyres that have a flat. Less and less people can change the tyres on their own, and even do not understand the construction and characteristics of different tyres, only believing what the vendor in the shop is telling them. Bad surprises then happen.

              • Flipper@feddit.org
                link
                fedilink
                arrow-up
                2
                ·
                edit-2
                10 hours ago

                Yes, writing safe code is a skill. But for most skills you need someone to teach you. My suggestion is, think about it differently:

                The compiler isn’t training wheels, but rather a senior dev, that quickly looks over your shoulder and tells you, hey you might have missed something here. You can at any point tell them, trust me bro for this part. They need at some points a comment in the form of lifetime annotations. They are pretty good, but not perfect.

                To pick up your example. They don’t tell you, you need a new wheel. They tell you, you’re bike has disc brakes, but your new wheel is missing the disk. When you later hit a wall, because you couldn’t break, you can check where you just said trust me.

                • Bogus007@lemm.ee
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  4 hours ago

                  @Flipper, if you just learn from one master, you cannot become a master in the field. As I said above: relying heavily on the compiler, even when this may be the best „teacher“, does not make you - I do not speak about you personally, but you in general, so all programmers - a good programmer. This is my major critic about Rust, while I do also understand its advantages.

    • GreenKnight23@lemmy.world
      link
      fedilink
      arrow-up
      13
      ·
      1 day ago

      I’m convinced MS is funding the rust foundation only so that the rust kernel rewrite will fracture the Linux ecosystem and weaken it’s overall standing.

      the fact that any rust community I’ve had the displeasure of working with is toxic as fuck only fuels my theory that MS wants it as inhospitable as possible to keep existing kernel devs “in their lane”.

      it’s really not a bad language, but the devs… ohhh boy…

  • prime_number_314159@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    22 hours ago

    We used to have good, strong open source tools made out of C (which is a lot like steel - it can only be worked by blue collar computer nerds with muscly brains). Now that steel core is corroding because of the influence of hackers and other white collar computer sorts with their creative problem solving, and unintended uses of memory.

    That new corrosion is called rust, and it eventually appears on every C project that’s left outside, unless someone comes along to brush it off occasionally.

  • hedge_lord@lemmy.world
    link
    fedilink
    arrow-up
    87
    ·
    edit-2
    2 days ago

    Rust is a programming language designed to run on crabs. It just happens to also run on computers. When rust programmers talk about the borrow checker, that’s something born directly out of having to run on crabs. It’s difficult to get the little guys to cooperate otherwise. And when they talk about rust having good error messages that’s because of the crabs too. The compiler is not just some piece of software, it’s a piece of software being run on crabs and the crabs have some measure of intuition to them. Basically what I’m saying is that carcinization applies to computer hardware.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    110
    ·
    edit-2
    2 days ago

    It’s a programming language, which is particularly relevant for Linux, because it doesn’t require a runtime (separate program that runs the code). This allows it to be used in the kernel.

    But it also means that it’s very good for building libraries. With a small bit of extra work, virtually any other programming language can call libraries implemented in Rust (like you can with libraries implemented in C).
    Add to that, that Rust allows for performance similar to C and makes lots of typical C bugs impossible, and suddenly you’ve got folks rewriting all kinds of C libraries and applications in Rust, which is something you might have also heard about.

    • riquisimo@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      4
      ·
      18 hours ago

      Thank you for the informative response. I knew rust was a programming language, but didn’t know it’s significance.

      • Wooki@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        14 hours ago

        Plenty of patched memory leaks in the last few years. You can pretend they dont exist.

      • Ephera@lemmy.ml
        link
        fedilink
        English
        arrow-up
        11
        ·
        20 hours ago

        Ah yes, intentionally misunderstanding someone’s comment. We’ve all seen them.

        I mean, what the heck is this passive-aggressive comment? If you disagree with me, then come at me.