Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Go is for writing api servers which otherwise should be written in python but must be fast.

Rust is for the lowest level code which is not assembly, with all the performance tricks, but that should be secure.

Rust is expensive to develop - if you can afford to use a GC, you should use a GC.

So people want to rewrite all the world's C and C++ to rust, for security. But people are less passionate about rewriting all the world's python into go for performance.



> Rust is expensive to develop - if you can afford to use a GC, you should use a GC

This has not been the case for many people using Rust, including myself. Once you learn the language, there is no "cost" to use it. In fact, the compiler simplifies much of the mental overhead when dealing with concurrency, sharing data, mutability, etc... Sure the compiler has some strict rules, but it's not expensive to develop in by any means.

I would also say Rust is in a sense higher-level than Go in terms of expressiveness and abstractions.


Rust can be hard to refactor. Not sure if that's a problem with Go, but it's a real cost.


How so? From my experience, I was able to make massive changes and the compiler would guide me through to make sure I didn't miss anything. If it compiles, it'll generally work minus any logical errors/changes.


There are definitely refactoring woes to be had when taking an existing struct and changing it such that it now stores a reference in one of its fields, requiring lifetime parameters to trickle down through your program. The compiler guides you in getting it all right, but it's something that I'd rather see an IDE do automatically in the future.


I used to feel the same way about Rust. But the more I started using it, the more I realised that it's fairly capable and I could use it much more than I had originally planned. While it's not as high level as, say, F#, some features are higher level than Go. For instance, error handling in Rust is nicer than Go. Rust's cost-free functional style is also pretty neat.


> Rust is expensive to develop - if you can afford to use a GC, you should use a GC.

I like GCs, but I wouldn't make such a blanket statement. Manual memory management as implemented in Rust also eliminates data races at compile time, which are in fact the last item listed in the original article.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: