BTW I think some anti-Rust people are more annoying than the worst Rust evangelists - seen some of them calling people not using Rust as “murderers”, because “memory leakage can kill at the right time” - but that’s due to them being evangelists to right-wing politics.

      • Anders429@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        I’ve done quite a bit of async programming and I can’t quite figure out what people are complaining about here. Best I can tell, they just don’t understand what async functions actually are.

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

          Most of the time, async tutorial makes you learn tokio, not async. If your program can run with only tokio::main, then you learned async. If not, you learnt tokio (except if you are spawning a future that should never stop)

          For example, my pet project only uses tokio::main to do async stuff. The only instances of tokio::spawn is make sure some SQLite transactions get polled to completion. I do need to replace them with a proper mechanism now that sqlx supports smol-rs

      • cjk@discuss.tchncs.de
        link
        fedilink
        arrow-up
        5
        ·
        3 days ago

        When people say “async is viral” in Rust, they mean that once you make one function async, that change tends to ripple through the rest of your code. Any function that calls it usually has to become async as well so it can await the result. In turn, the callers of those functions often need to become async too.

        This propagation can continue all the way up the call stack until you reach your application’s entry point. The main exception is when you introduce an explicit synchronous-to-asynchronous boundary, such as by using block_on, which drives the future to completion without requiring the caller itself to be async.

        • RustyNova@lemmy.world
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          3 days ago

          Yeah but it’s not really a problem with rust but how the language pattern is made. It’s the same in JavaScript/typescript, and Python IIRC

            • Pup Biru@aussie.zone
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 day ago

              along with most modern languages… it’s the way we deal with async when you don’t want callback hell. it’s just a complex problem domain

              like… what… JITs are complex so that’s a problem for V8 specifically?