I am not hating on Rust. I am honestly looking for reasons why I should learn and use Rust. Currently, I am a Go developer. I haven’t touched any other language for years, except JavaScript for occasional front end work and other languages for OSS contributions.

After working with almost every mainstream language over the years and flitting between them on a whim, I have fallen in love with Go. It feels like ‘home’ to me - it’s comfortable and I enjoy working with it and I have little motivation to use anything else. I rage every time I get stuck working with JavaScript because dependency management is pure hell when dealing with the intersection of packages and browsers - by contrast, dependency management is a breeze with Go modules. I’ll grant that it can suck when using private packages, but I everything I work on is open.

Rust is intriguing. Controlling the lifecycle of variables in detail appeals to me. I don’t mind garbage collectors but Rust’s approach seems far more elegant. The main issue for me is the syntax, specifically generic types, traits, and lifetimes. It looks just about as bad as C++'s template system, minus the latter’s awful compiler errors. After working almost exclusively with Go for years, reading it seems unnecessarily demanding. And IMO the only thing more important than readability is whether it works.

Why should I learn and use rust?

P.S.: I don’t care about political stuff like “Because Google sucks”. I see no evidence that Google is controlling the project. And I’m not interested in “Because Go sucks” opinions - it should be obvious that I disagree.

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    It looks just about as bad as C++'s template system, minus the latter’s awful compiler errors.

    I’d say they’re incomparable. One’s a Turing-complete programming language, the other is not much more powerful than generics in a language like C#. That’s not to say that your impression is incorrect - both are significantly more complex than what Go had for the longest time (no generics), and likely more complex than what Go has now (though I haven’t looked much into Go’s new generics system to be honest).

    If you’re looking for a reason to use Rust, I recommend picking it up and doing some projects in it. There are many, many reasons why one would choose Rust for a project (security, correctness, needs to be low level, preference, etc) and many documented scenarios where companies have found switching to Rust to be beneficial to them, but at the end of the day, only you know what your requirements and preferences are.

    It seems like you prefer highly readable code. This is a pretty subjective thing though, and you may find that Go is more readable to you than any other language. I would disagree, but again, it’s a matter of preference. For some, C++ is the language they find most readable. Regardless, the only way to know if you’ll like it and want to use it is for you to pick it up and use it, and develop your opinions based on experience. If you find that spending time learning it will be a waste after trying it out for a little bit, then you have your answer.

    • OffByOneError
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      For some, C++ is the language they find most readable

      I’m skeptical about that statement! lol.