• fubarx@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    4 hours ago

    So many system bugs are because of unclear memory ownership, buffer overflows, and race conditions. C/C++ don’t help you avoid any of these footguns. Any other system that relies on GC is non-deterministic and prone to mystery hiccups, which is why OS and driver tech has been pretty much the same foundation since the 70s.

    Rust lets you avoid 2 of those 3 issues (thread race conditions are still a thing). And being compiled, instead of interpreted bytecode means you can get reasonable performance on smaller machines. No wonder these OS guys are so excited.

    • BartyDeCanter@piefed.social
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 hours ago

      Yup. Most of my career has been working on embedded realtime software, so interpreted languages are right out and really only C and a subset of C++ are available. I’ve now been using Rust in that way for about nine months now and while the syntax is sometimes silly feeling, being able to not worry about some many other issues has made development much better.

  • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    6 hours ago

    I’ve got a non trivial project in Rust, and it takes like 5 min to compile on my machine. Personally, I don’t know how anybody can call this fun. I find it insane to have to wait minutes to see the changes and to iterate. And like sure you can break shit up into crates to speed up compilation, but to do that you already have to have a design you’re happy with and that’s stable.

    • asdfasdfasdf@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      47 minutes ago

      Five minutes with build cache? Or from cold build?

      With cache, then there’s almost certainly something wrong with your computer or project.

      Also… you aren’t building with --release every time are you?

      • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        2 hours ago

        I recall looking at mold, but it didn’t end up helping much in my case. And haven’t looked at sccache, that might actually help if it can cache compilation incrementally in an intelligent way.

    • trem@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      4
      ·
      3 hours ago

      5 minutes sounds like way too much, unless you mean a fresh compile. But then you shouldn’t need to wait that long between changes, since incremental compilation should kick in then.

      And like sure you can break shit up into crates to speed up compilation, but to do that you already have to have a design you’re happy with and that’s stable.

      I mean, if you have your modules structured in a tree structure and with proper visibility, then it isn’t a particularly big leap to put it into a separate crate. You just move the files, maybe fix some visibility modifiers still, and then a bit of boilerplate to add it to the workspace.

      It’s only really when you’re publishing to crates.io, that you don’t particularly want to keep changing the names/scopes of the crates, as they’ll stick around on there for the foreseeable future.

        • Dessalines@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          51 minutes ago

          5m seems about right. Lemmy’s from scratch builds are ~3.5m on a fast machine, and we have ~60k lines of code, and are using some with large libraries with lots of features enabled.

          But you really should only ever have to do a from scratch build either at the beginning, or when you deploy. When developing, your IDE should only ever really run check or clippy, which should take seconds at most.

          • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
            link
            fedilink
            arrow-up
            2
            ·
            43 minutes ago

            I should really revisit this. I know I looked at it again. The compiling crops up I you actually want to run the app and test drive the changes live.

    • eldavi@lemmy.ml
      link
      fedilink
      English
      arrow-up
      11
      ·
      edit-2
      6 hours ago

      I find it insane to have to wait minutes to see the changes and to iterate.

      i did devops between 2015 & 2025 and got used to the cadence of waiting between 15 & 180 minutes for testing/production pipelines to finish vetting the work i submitted to them.

      i went back to doing IT last year and setup similar pipelines to update the code base my predecessor left behind and my new boss expressed the same consternation about waiting for your changes to iterate.

      i’m thankful for it because it gives me 30-ish minute windows to browse and annoy people on lemmy throughout the day. lol

        • eldavi@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 hours ago

          this comic will forever make me flinch. lol

          back around 2010, i did IT at a place that got a new isilon cluster to alleviate storage space woes with our netapps and the software engineers used this comic to make fun of the work we did when it caused a bottleneck over the network. lol

        • JackbyDev@programming.dev
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 hours ago

          Gosh. I remember working with this back in 2019 and earlier. Our legacy products ran on it. I remember a new service we made (before Spring Boot really took off) used TomCat. It was so much easier to mess with. I asked why we don’t use that for our main product. Imagine my surprise when they said we actually used to.

          I’m sure they had their reasons, I was a younger dev at the time and didn’t have insight into why they changed it. But still. Everything is so simple now. Java to run your jar. Your jar has your server built in. Done. And that’s not even including containerization.

          I do miss Jenkins though. GitHub Actions seems to be the new hotness. Maybe I just don’t have the muscle memory yet, but it can be annoying.

          • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
            link
            fedilink
            arrow-up
            3
            ·
            edit-2
            47 minutes ago

            Yeah, not gonna miss app servers. I do find the JVM was kind of made for a different era though. It’s basically designed to act like a VM on top of which all your apps run. So, startup time isn’t really a problem, and it wants to grab as much memory as it can by default. But nowadays everybody just makes small self contained apps that you can scale horizontally, so this whole model the JVM is tailored for isn’t really used outside big enterprise. And Jenkins was alight, I used to use it back in the day too. For the most part, I do find GitHub actions are an improvement though. You just make a script and magic happens.

    • fubarx@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      I’ve got a pretty large Rust/Tauri program going. Breaking things into crates help, but if you touch enough bits of common libraries, everything needs to get rebuilt anyway.

      I use Makefiles for everything. What I found helps is breaking out the parts that don’t change much into separate Make commands (like generating icons, linting, frontend, tests, etc), then leaving “make go” as the simplest inner iteration loop. That way, it’s a lot more bearable.

      There’s also “make build” and “make fullclean.” You start one of those and take a long break.

      • ☆ Yσɠƚԋσʂ ☆@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        4 hours ago

        Right, you basically have to start building a rube goldberg machine for compiling your app just so you don’t have to wait for minutes on end. And to me it is absolutely bananas that you can make a compiler this slow on modern hardware. Coming from largely working with Clojure where I have a live application I can interactively load code into as I edit it, this whole process feels insane.

  • HaraldvonBlauzahn@feddit.orgOP
    link
    fedilink
    arrow-up
    59
    ·
    15 hours ago

    Kroah‑Hartman consistently framed language choices in terms of reviewer workload rather than developer convenience. Linux has “over 5,000 developers” but “about 150 core maintainers that review the majority of the code,” a skew that drives his priorities. “We optimize for reviewers. We don’t optimize for developers because we have a lot of developers,” he said, suggesting Rust’s ability to enforce locking and lifetime rules at build time means reviewers can spend their limited bandwidth on logic rather than bookkeeping: “If it builds as a reviewer, I know it’s OK. I can look at the logic.”

    That’s a great point. Living open source code must be readable and maintainable. Rust is an excellent match for that.

  • HiddenLayer555@lemmy.ml
    link
    fedilink
    English
    arrow-up
    14
    ·
    edit-2
    15 hours ago

    Don’t know about “fun again” but definitely a lot less nervewracking and paranoia inducing.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      8
      ·
      7 hours ago

      It is hard to think in and see through the eyes from a Kernel core maintainer, if you don’t do this kind of stuff at this level. Instead enforcing style guides, looking for edge cases and unexpected issues because C allows to do anything must be terrifying. Part of this “nonsense” goes away using a language that is designed to handle this better. And you know, learning a new language with features you always wanted to have in C might be exciting too, I don’t know. I can imagine Rust being more fun than C in the Kernel for some, so this is not a wild take or anything like that.

      I think the most exhausting part of Rust was two fold: a) the language was not designed to be used in the Kernel, they needed to update and discuss after real world usage, and b) the push back from C developers who either didn’t understand Rust or think its bad for the Kernel. The childhood illnesses of Rust in Linux is seemingly over.

  • pewpew@feddit.it
    link
    fedilink
    arrow-up
    10
    arrow-down
    8
    ·
    12 hours ago

    What part of Rust is fun?

    C is fun to me because the syntax is easy to understand and straight to the point. C is also great for learning low level coding, I find Rust so confusing

    • asdfasdfasdf@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      45 minutes ago

      Rust us way easier to understand for me (and I’d guess most people) than C.

      Rust is fun because it’s the only mainstream language with an affine type system, which allows some really cool patterns like the typestate pattern. And the fact that there’s no inheritance or null or exceptions is amazing.

      • Nalivai@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 hours ago

        The first picture isn’t what people write, even though it’s technically compilable, it’s not what C is.
        The second is a normal syntax, pretty simple to understand if you write enough code.
        C is very simple language at it’s core, and it allows for it to be used in a very complicated systems.

      • db2@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        11
        ·
        9 hours ago

        Were you trying to post examples of it being easy or do you actually find those hard?

        • esa@discuss.tchncs.de
          link
          fedilink
          arrow-up
          5
          ·
          6 hours ago

          I find the C type syntax turgid. It’s fine for the most basic types, but the name-in-the-middle style doesn’t scale at all, and it’s not hard to understand why later languages separate name and type, no matter which side of the name the type goes on.

          I find Rust easier to read in that regard, even though picking <> for generics was likely done to be familiar for C++/Java types rather than easy to parse. (See also: the bastion of the turbofish)

    • slacktoid@lemmy.ml
      link
      fedilink
      English
      arrow-up
      18
      ·
      12 hours ago

      Rust requires you to unlearn some of the C and CPP habits. And so it’s like learning a language that approaches things differently. That is pretty fun to see how another language solves a problem etc. I think rust is a very fun and interesting language tbh. But you are free to not like it, that’s all good man. That’s why we have different languages. After getting into rust, for me, you need to convince me to use C or Cpp, they have their niches for sure, but rust allows that too like embedded programming etc.

      • BrianTheeBiscuiteer@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        7 hours ago

        This checks out. I tried some Rust coding challenges and couldn’t get my stuff to compile mostly. When I see the solution it seems straightforward but also not intuitive.

  • SocialistVibes01@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    16
    ·
    13 hours ago

    Greg is evil, don’t mind MIT code in the kernel and it was the main proponent of AI in the maintenance process.

    The Linux Foundation (MS, Oracle, Anthropic, IBM, you know the drill, probably Palantir is there too, just in secrecy) guys love him.

    • trevor (any/all) @lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      7 hours ago

      First, using Rust does not in any way mean that you’re forced to use pushover licenses. I license all my Rust code as GPL.

      Second, I hate pushover licenses, but I don’t see GPL projects using pushover licensed code as a problem. You’re essentially relicensing the pushover licensed crap as copyleft, which is a good thing. Any improvements that they make to MIT licensed stuff will only be available to other copyleft project, thus making the base MIT stuff less appealing.

    • HaraldvonBlauzahn@feddit.orgOP
      link
      fedilink
      arrow-up
      11
      arrow-down
      1
      ·
      edit-2
      7 hours ago

      Greg is evil, don’t mind MIT code in the kernel and it was the main proponent of AI in the maintenance process.

      That’s a mouthful, can you expand with facts?

      don’t mind MIT code in the kernel

      Last time I checked, the kernel used GPLv2? Could it be you misunderstand something about cross-using code with different licenses ?

  • hoshikarakitaridia@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    4
    ·
    13 hours ago

    Interesting, that’s a real change to the last discussion in the email chains where they kind pushed rust out of the core development and said they would need to fork the kernel / make their own smaller modules to bs adopted.

    I still remember one of the maintainers leaving over concerns about multiple languages in the kernel and Linus Torvalds having to chime in personally to set the new direction.

    • HaraldvonBlauzahn@feddit.orgOP
      link
      fedilink
      arrow-up
      7
      ·
      edit-2
      13 hours ago

      No, that is settled and it is also a successful, gradual evolution. It just makes sense to start using Rust for drivers and at the periphery of the kernel, and use it in core subsystems perhaps later.

      Any successful change in such a large project will be evolutionary. And also, for gaining security benefits, it makes sense to use Rust in new drivers, new modules, perhaps network stacks, and later file systems - but these roll much more slowly.

      • hoshikarakitaridia@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        20 minutes ago

        Ngl I don’t get the downvotes.

        I have no opinion on pro or contra rust in the Linux Kernel. I have no dog in the fight and I do not understand it well enough.

        Or did I get something wrong? The email chains are there. The core developers did argue. Linus did chime in. That one dev stopped working on it. what am I missing?

        I’m so confused.