4 ms·
I have been trying to discourage Go vs. Rust comparisons since time immemorial, given their wildly different purposes and audiences. The eagerness to compare t
by kibwen 12y ago
I have been trying to discourage Go vs. Rust comparisons since time immemorial, given their wildly different purposes and audiences.
The eagerness to compare the two seems to stem primarily from 1) both market themselves as "systems" languages (though the vagueness of that term makes this a tenuous connection), 2) both have a focus on concurrency (though in the year 2014, if your language doesn't have a great concurrency story, you've already lost), and 3) the tech crowd seems to adore the imagined narrative of Google vs. Mozilla (though both languages are somewhat disconnected from their backing companies).
As a Rust follower, I would really love to see more comparisons to C++, Erlang, and Ada.
- jsmthrowaway 12y agoNone of those reasons apply to me, and I think you're overlooking a simple one: As an SRE, I compare them because I'm looking for the next language to adopt as my primary systems/infrastructure language. I have enough issues with C++11 and Python in large systems that I'm looking for an expressive language in which I can work fast and build robust systems. Go and Rust are the finalists for that, with Python keeping the scripting side. Go just happened to finish first. And, I think they both target the same use cases, they just adopted a different mind set on the way there. Most outsiders to Google don't realize this, but Go expresses volumes about the way that Google works internally. And, as with Protocol Buffers, the really awesome stuff in the technology was held back; any Googler will tell you that Go inside the veil is a vastly different experience because of the language-agnostic systems that Google has built internally. At the end of the day, I want a language to write the various tools and systems I need in my SRE life. I've had a hodgepodge until now, and Go is appealing because I can centralize on one (with one toolchain). Rust is becoming more palatable every day.
- pnathan 12y agoI sit in that area (SRE/DevOps/Tools) as well, and I strongly believe that Rust is a better foundational language because of the type system strength and guarantees. Particularly useful is the `enum` type and type matching. I want, simply put, to be able to write code that is "bulletproof" after I've brought it to deployment, and Rust gives me some awesome tools for that. (I've also come to understand that Go is an extremely sharp tool for Google's problems - the style of coding, the concurrency, the expectations of the developers (look at the Google style guides to see the culture of development there, there's a harmony with Go). Your harmony with Go reflects your harmony with Google's problems).
- TheHydroImpulse 12y agoI would be very interested in comparisons to Erlang. Erlang seems to be the king of reliable and fault-tolerant systems and Rust seems to have taken lessons from it.
- Ixiaus 12y agoNot much to compare it to there. Rust's type system is much more advanced which is a big win and it is lower level but Erlang's model of reliability is based heavily on the BEAMVM. Rust has a good concurrency model but I doubt it will compare favorably with Erlang's distributed computing primitives and fault-tolerance features (read, fault-tolerance is not equivalent to type safety!!)
- TheHydroImpulse 12y agoThanks! Yeah, I was specifically pointing to how tasks in Rust work in terms of failure. The approach of "if it fails, just kill it and potentially restart it". This is the same approach that Storm has managed to be fault tolerant.
- Ixiaus 12y agoWell, you could build a process supervisor that runs in its own forked resource (I'm sure, I don't know the language too well) - we have that in Haskell too (you can see similar code in the Cloud Haskell project where you give a supervisor some child specs and it "supervises" them with a couple different restart strategies). Storm does it more at the machine level, while the philosophy is the same there it's not really done in the language but by Nimbus (correct me, someone, if I'm wrong). The things in Erlang that are novel are really features in its BEAM VM, and not as much in the language. Distributed RPC, a DNS system built in for discovery, hot-reloading, heartbeat, etc... I'm sad that Storm ended up being built on Java - Erlang would have been a perfect and probably better way to implement it.
- TheHydroImpulse 12y agoIndeed. I have never touched Erlang, so thanks for the insight. Storm is a hybrid Java/Clojure project, so it's much better than simply a Java project. But yeah, the fault tolerance is not in the language, but the project itself.