6 ms·
I feel like Rust and Go are fundamentally different use cases and I wish people would stop the language debate. Rust: For code that isn't meant to be iterated
by alexbanks 6y ago
I feel like Rust and Go are fundamentally different use cases and I wish people would stop the language debate.
Rust: For code that isn't meant to be iterated upon, that must be safe/correct while also being performant.
Go: For code that is meant to be iterated upon frequently, that must be performant and easy to maintain.
I would like my tools to be written in Rust, and I would like to interface with them in Go.
- zozbot234 6y agoWhat's wrong with iterating on Rust? Comprehensive type checking makes refactorings a lot easier than something like Go. And you can iterate starting from a simple, working solution that relies on marginally more expensive features, such as .clone(), Rc<…>, Cell<…> or RefCell<…>, Any for dynamic data etc. etc.
- throwaway894345 6y agoRefactoring is safer with Rust, but in generaly Go is not so unsafe that refactoring costs more than it saves on the frontend. You can write a lot of Go (and contrary to the memes in this thread, you can still leverage the type system to great effect wrt safety) in the time it takes to get a little Rust to compile; however, Rust is getting better all the time.
- Ericson2314 6y agoI think you are missing the point of type systems. Our current economy doesn't value correctness at all. Code is rushed out, and usually live longer than it was designed too. This mimicks the the largest infrastructure debt of America (and to a lesser extent, the western world as a whole). But the same shoddy system is also constantly changing the requirements, precisely because nothing is built for posterity and there's tons of make-work churn. Good type systems make code far easier to refactor, and refactoring (as opposed to slapped-on new code) is the only way to handle shifting requirements without being crushed under ones own weight.
- alexbanks 6y agoI'm not missing anything. I'm well aware of the value of type systems, as I am our current cultural decision to value speed over correctness. I'm not confident that average level developers are able to ship features in Rust as quickly as they would in Go, which is the root of my point. Those building tools, which generally do not have the same success metrics with respect to speed and correctness, should use the language with a focus on safety and correctness. Those whose positions do not lend themselves to safety and correctness should not use that tool.
- zozbot234 6y ago> I'm not confident that average level developers are able to ship features in Rust as quickly as they would in Go Even if this was a genuine concern, they should still use Rust. Because it will be far easier to refactor the code that they ship into something that is safe and correct, compared to rewriting a Go codebase.
- alexbanks 6y agoWe can agree to disagree. The whole point of my post is that I do not agree with your statement.
- ameixaseca 6y agoWhich code is not meant to be correct?
- alexbanks 6y agoThis is a silly strawman. All code is meant to be correct, but often times close enough to correct is good enough (as is literally the whole point of my post). Most businesses operate on code that is close enough to correct for their individual risk tolerance, and increasing that correctness would reduce speed/throughput and increase cost.
- necubi 6y agoI think that's totally backwards. A good type system _improves_ iteration speed, it doesn't slow you down. When I refactor a Rust program, I have very high confidence that if it compiles, I haven't accidentally introduced a bug. I don't write much Go code, but my company does. I have seen so many incidents and bugs whose root cause was: someone changed a library, that broke the semantics that users were relying on, but everything still compiled fine, so nobody noticed the subtly wrong behavior for a long time. An incredible amount of money has been lost like this. Go simply does not give you the tools to prevent these issues in the type system, you have to rely on really thorough unit tests (which inevitably don't get written in the spirit of "moving fast".)
- alexbanks 6y agoAnd you're welcome to think that. YMMV.
- geodel 6y agoMaybe you need to think why your company is not writing in Rust. Is there some quality of Rust that individual users prefer more than companies in general. Whenever I hear about Rust in companies same dozen or so companies get mentioned every time.
- necubi 6y agoThe specifics of what languages my company writes are mostly historical, and I would say that Rust was not ideal for writing high-throughput network services until this year with the release of async/await. But in general, companies adopt Go for the same reason they adopt MongoDB [0]: it's really easy to get started with, and get something that "works." The pain comes months or years down the road, and by then you're stuck with it. [0] A company I previously worked for starting using MongoDB as a small startup, starting finding the limitations about 6 months later, but ending up spending an incredible amount of engineering time over 5 years getting rid of it.
- alexbanks 6y agoYou're a person that really does not like the Go programming language, and that's okay, but to try and paint a perfectly fine tool as bad because someone used it incorrectly, and then compare it to a pretty objectively bad product is silly. We get it. You don't like Go. Don't use it. That's a perfectly fine option. Plenty of very successful companies, open source projects and services all work with Go (and literally every language) without issue. You not liking something does not make it bad.
- Gepsens 6y agoI hope you are kidding mate. I've been solo maintaining 50k lines of Rust iterating over a few months and it's a breeze.