4 ms·
While I don’t disagree about the consideration of Go, calling Go Rust-like is really strange. I think of Go as more Java-like than Rust-like. But even that’s a
by bluejekyll 7y ago
While I don’t disagree about the consideration of Go, calling Go Rust-like is really strange.
I think of Go as more Java-like than Rust-like. But even that’s a hard comparison. Really, Go is C-like with a garbage collector for memory safety.
Rust is Java or C++-like with a strongly typed compiler, support for generics (not Go), lifetimes for memory management and no GC (closer to C++), and a type system that enforces some constraints around concurrency. I guess they are similar in that they both (by default) create static binaries, but so does C and C++ (if you want).
Rust and Go seem to get lumped together because they both came on the scene around the same time, but that is pretty much where the comparison ends.
- apta 7y ago> Rust and Go seem to get lumped together because they both came on the scene around the same time That, and that the golang authors at that time claimed that it was a "systems language". They would later go back on that by attempting to redefine what "systems language" meant.
- pjmlp 7y agoHowever Go is indeed being used as real systems language, even if the anti-GC crowd deslikes it. Examples in production, gVisor, Android GPU debugger, Biscuit and other research OSes, tiny GO for embedded targets, compiler development.
- apta 7y agoI'm not anti-GC :) The language itself though doesn't lend itself well to larger complex designs however, which I feel precludes it from more interesting projects, and we can see that by the fact that it's mainly getting used for "devops" kind of work. Compare that to Rust or Java (e.g. GraalVM) or C#, the latter two which weren't really advertised as "systems" languages, yet were used there anyway (maybe real-time Java is something else though)
- pjmlp 7y agoI am also a Rust, Java, C#, C++, ML,... kind of dev. However as safety minded person, I rather see such projects being done in Go than C, even if I am not a big Go design's fan. This is actually the area where you will find positive comments from me regarding Go.
- Matthias247 7y ago> Rust and Go seem to get lumped together because they both came on the scene around the same time, but that is pretty much where the comparison ends. I don't think it has to end right here. It's definitely true that Rust has a much stronger type system and is more suitable for some kinds of applications (super-low level, libraries, things were we try to avoid allocations, etc.). However there is a certain set of applications for which both languages are well-suited and potentially more appealing than the other mentioned languages (e.g. Java, C#, Python, etc). Those are applications were we want to have a low memory footprint and ahead of time compilation (to improve startup times and to avoid having to ship also a big VM). Command line applications or daemons fall into the category. And we can definitely see both Rust and Go gaining tractions in those domains.
- lacker 7y agoRust and Go are both close to being as fast as C++, but not as terrible to actually use. In my subjective opinion, no other languages fit that niche.
- e12e 7y agoGo is to c as Java is to c++.