• Deely@programming.dev
    ·
    1 year ago

    Rust has gained immense popularity for its ability to help developers write robust and efficient code without sacrificing ease of use.

    Rust's unique features and design principles grant it several advantages over other programming languages

    I don't want praise and ads, I want honest and clear points: what good and what not so good.

    • swordsmanluke@programming.dev
      ·
      1 year ago

      Good:

      • fast
      • high-level language constructs like iterators
      • memory bugs harder to write vs C/C++
      • compiler errors are ridiculously helpful
      • borrow checker makes some hard things easier (memory management; Inter-thread communication)

      Not so good:

      • you will not like the borrow checker, even as it saves you from yourself
      • executables are larger due to static linking
      • language is BIIIG
      • compilation is slow (but getting better)

      Overall, I like Rust a lot. I think its reputation as a great language is well-deserved. It's not an "easy" language to use, but it prevents so many footguns... It takes me longer to get to a working prototype in Rust. But the first time it compiles successfully... it's probably right.

      If I'm working on a project that needs to be fast, I'll reach for Rust over C these days.

      • Deely@programming.dev
        ·
        edit-2
        1 year ago

        Thanks, you comment definitely makes me want to try Rust.

        Could you tell me, can I use Rust as general purpose application language? Something like: create small executable app (win,unix,mac) that read some files, and do something with it, create GUI app that connects to DB and do something with it, etc?

        • swordsmanluke@programming.dev
          ·
          1 year ago

          Yesbut...

          Rust's GUI frameworks are all (afaik) still pretty early and a little clunky to use.

          ...and compiling for Windows is a little clunky.

          From a purely yes/no perspective, you can absolutely use Rust for building desktop GUI apps... But I'd recommend using a different language unless your app has really tight performance requirements.

          If you want to make a cross platform app with good GUI support, I'd a actually recommend checking out Godot. It's technically a game engine, but the built in scripting language (gdscript) and GUI components are really great. If gdscript is too slow for your purposes you can swap in a lot of other languages (including Rust) though C# is the best supported of these.