5 ms·
[deleted]
by als0 6y ago
[deleted]
- deaddodo 6y agoThere never was a battle. Rust is the up and coming Systems Language (classic definition) and Go is the up and coming Systems Language (modern, colloquial definition). They’re in completely different spheres, with regards to practical production usage.
- eloff 6y agoYes, having used both I would say there is only a small overlap between them. Go generally is nicer when you can afford a GC and a runtime. By nicer, I mean you'll get things done faster. Rust generally is nicer when you can't, or you need better C interop, more low-level control, or you need a stronger type system for some reason. It's not as productive as Go, or at least I'm far from reaching that point after months of full time rust development, and I'm a pretty experienced polyglot developer.
- anw 6y agoJust wondering, what parts of Rust do you feel take longer to code out vs doing so in Go or its contemporaries?
- eloff 6y agoMost things take longer. Dealing with the more expressive type system, additional errors and warnings, figuring out generic functions, types and type constraints. Having the additional concept of ownership to think about, design around, and run smack into face-first. GC is a joy by comparison, it requires zero effort. Figuring out which abstraction to use, in Go there is typically only one obvious way to do it. Dealing with less mature libraries. In general there is just way more cognitive overhead working in Rust, much more to think about, more options to choose from, and more constraints. Some of this should pay itself back by avoiding certain classes of bugs - but I find on a solo project (I've used Go in teams, but not Rust) I get very little benefit here because all the code is written by me, and I'm experienced enough not to make a lot of the mistakes Rust can protect me from, like race conditions or nil pointers/interfaces most of the time. On a larger team you'd get more benefits here, especially if working with more junior developers. But I don't think you ever get to the same productivity you get with Go. So my advice is if you can afford a GC, and you don't need too much low-level C interop or performance optimiations, choose Go. I do want to add, that from a software craft perspective, I find Rust more elegant to read and write, but only really when I'm not pulling my hair out because of the borrow checker, or hairy details around closures, or whatever else. I do take a certain satisfaction in that elegance sometimes, but overall I'd rather get stuff done.
- petre 6y agoWhy not pick D and use a GC when you can afford it and @nogc otherwise? C interop is also great, productivity is good, probably comparable to Go.
- pjmlp 6y ago+1 for D. What plays against it is having a tiny community without mega-corp sponsorship, so anyone that wants features has to do them themselves.
- msla 6y ago> Rust generally is nicer when you can't [afford GC.] Since this doesn't include "OS kernel" what is the state of Rust on deeply embedded devices? Rust for PIC12 anytime soon?
- pjmlp 6y agoSure it does, https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kernel.Mod.txt https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne... https://labs.f-secure.com/blog/tamago/ https://labs.f-secure.com/blog/tamago/