3 ms·
I think go is failed, compare to rust. 1. not memory safe on multi-thread 2. no generic support 3. error handle is full of pain compare to rust's Result<T>, Opt
by rsarsarsa 12y ago
I think go is failed, compare to rust.
1. not memory safe on multi-thread
2. no generic support
3. error handle is full of pain compare to rust's Result<T>, Option<T> and try!
4. gc can't be disable
5. no RAII support, defer can be forgot
light-weight thread (spawn) and channel (thread safe FIFO) already exist in rust that make golang more meanless.
If you think still any advantage of go please tell me.
- rsarsarsa 12y agoJust downvote if that make you feel good because your poor head can't prove go is better anywhere :P
- Skinney 12y agoGo is stable, wheras Rust is not. Go also targets other use cases than Rust, and so the two are not directly comparable. 1. Rust cannot guarantee multi-threaded memory safety in all cases. Care, as in Go, must still be taken. 2. I agree with you here, I think Go would be better with generics. But apparently, most people don't have a problem with this. 3. Rust and Go's error handling is based on the same principle: force the user to deal with errors, instead of ignoring them. While Go's way of handling things can be a little more verbose, in principle I don't see the big difference. 4. Alot of people will argue that this is a good thing. Using a GC by default makes certain things easier, like writing datastructures (especially immutable ones) without reaching for 'unsafe' code. Having a GC also means you don't have to mind memory fragmentation, as you do with a manually malloc/free based allocation. 5. RAII is great, but loses some of it's use in GC based language. Defer is, IMHO, a much better option than the other solutions I've seen in other GC languages (Javas try-with-resources and C#s using) Just because you can do the same thing in language X, doesn't make language Y obsolete. Advantage of Go, for me, is less verbose code (implicit interfaces for the win) and a fantastic, stable and huge standard library. I also like the strict compiler, and that the language has a GC by default, makes certain things easier, and for most tasks I don't need the predictability that you get with manual memory management.
- Jweb_Guru 12y agoWhile I do generally agree with what you've written, I do want to take issue with point (1). Rust is actually intended to guarantee multi-threaded memory safety in safe code. Period. If you can get it to behave otherwise, it's a bug in Rust.
- Skinney 12y agoTrue. What I really meant is that safe code can interact with unsafe code, and thus cannot guarantee everything working correctly. Of course, this is bug with unsafe code, my bad.
- bovermyer 12y agoYou are, of course, entitled to your opinion. But "go is failed" is a little strong, don't you think? Wouldn't it be more accurate, and less ornery, to say that you personally don't like Go? For my part, I like Go because it offers a great, if nascent, alternative to PHP. That's the gist of it, anyway.