Rust vs Go in 2023

Which is better, Rust or Go? Go or Rust? Which language should you choose for your next project in 2023, and why? How do the two compare in areas like performance, simplicity, safety, features, scale, and concurrency? What do they have in common, and where do they fundamentally differ? Let’s find out, in this friendly and even-handed comparison of Rust and Golang.

  • echindod@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    My next project is dealing the RDF. I really wanted to use Go for this, but there aren’t any fully features RDF libraries for Go. Rust has a few pretty mature RDF libraries, so Rust it is.

  • somegeek@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 year ago

    my somewhat controversial opinion:

    Never use a language that is controlled by a big enterprise. Look at Java, look at C#, yes they are strong and the market for them is usually good, but they are absolutely not fun to work with. You have to just stay in their ecosystem and you’re forced to use their tooling, and their stupid decisions. For example try to develop a .NET app on linux. Or do almost anything with Java. It’s a huge pain in the ass.

    So I would never get too serious with Go. But rust is like C, and JS, although it has flaws, it’s much more fun to work with, and its not controlled by anyone, and will be here for a couple of decades atleast.

    • atheken@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      1 year ago

      .net has been targeting Linux for like 7 years. There’s open source tooling for it, and you can also buy Rider if you want more comprehensive editor support than vscode (which is quite good and runs everywhere, including the browser).

      Java is more complicated, but in either platform, there’s tons of open source frameworks, like log4j that you can pull in without any quality control or direction from “large corporations.”

      go was developed by a little company you’ve probably never heard of called “Google,” and they are their first/biggest customer.

      rust is interesting, but appears to be governed by a small group of people with some internal drama, and is heavily opinionated to the point that “modern” features won’t be added until they are considered table stakes for any language that hopes to gain traction.

      I don’t really understand your argument at all. It seems pretty flimsy.

    • sovietknuckles [they/them]@hexbear.net
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      1 year ago

      You have to just stay in their ecosystem and you’re forced to use their tooling, and their stupid decisions.

      To use Go as an example, Google wants Go developers to use boringcrypto. 2 years ago, a Red Hat developer added OpenSSL support to boringcrypto and submitted a CR, which was outright ignored. Months later, Google explained that they’re ignoring it because “I don’t think OpenSSL support is on our roadmap for boringcrypto”. Google wants so badly for boringcrypto to not support OpenSSL that they ignore code reviews, even when multiple people followed up afterwards saying that they really wanted OpenSSL support to be added.

      That’s not open source, it’s just writing proprietary software where other people can see it.

    • donio@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I think the reason you are getting downvoted is that Go is not at all like your characterization of Java and .NET. In fact Go was developed as a reaction to some of those problems and it’s very well suited for developing things like CLI programs on Linux. Can you imagine tools like fzf, restic or rclone written in Java?

      Also, in many ways Go is arguably closer to the spirit of C (despite the GC). A small, pragmatic language that you can keep in your head, little magic, the code does what it says. Rust is more akin to the C++ kitchen sink approach. Neither is inherently better than the other though and I am glad that we have several decent options with different trade-offs for different use cases.

  • zik@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    All languages have their place and there’s no simple “better” or “worse” between any of them.

    Go’s great for quickly and efficiently writing web services and other general programs. It’s clean, simple and quick to learn. Executables are pretty fast and it’s safe.

    Rust’s aimed more at systems level programming like operating systems etc. but it’s also suitable for general programs. It’s complex and hard to learn but powerful according to its advocates. Like Go, executables are fast and it’s safe.