Live data from Hacker News

Why Go Is Not Good

yager.io

91–100 of 367 posts

Re: Why Go Is Not Good

#91
Go is designed to be a niche language. A very big niche, but essentially still a niche: service components in clouds, where computing efficiency financially trumps development times.

Go is more productive than C++, but less so than Python or some other alternatives. Go's tooling, linking and libraries make it useful in the Cloud, less so on mobile or personal computers. And the lack of third party libraries, combined with a relatively slower speed of developing these libraries (again compared to Python, javascript and others) means that Go will have a hard time going beyond cloud services.

Re: Why Go Is Not Good

#93
I just spent the weekend learning Go and writing a single writer multi-reader hashtable for threadsafe access. I picked it deliberately because it's against the philosophy of the language, which is to share by communicating instead of sharing data structures directly. It was painful to write:

  // Do NOT reorder this, otherwise parallel lookup could find key but see empty value
  atomic.StoreInt32((*int32)(unsafe.Pointer(uintptr(uint64(slot)+4))), val)
  atomic.StoreInt32((*int32)(unsafe.Pointer(slot)), key)
However, the non volatile, non unsafe parts of the code were an absolute joy. Testing was a joy, compiling was a joy, and benchmarking was a joy. I was impressed that it allowed me to bypass the type system completely and do nasty, nasty things in the pursuit of performance. I want a language that lets me do nasty things where I must, but that makes the other 95% of the program, and the job of compiling, testing, and maintaining that program easy. Go excels here. Rust, C++, Haskell, Scala will never be good at that because they're too damn complicated (although each of them make the nasty parts a little less painful!)

The end result of my weekend's hacking? On an i7-4770K @ 3.5ghz

  BenchmarkGoMapInsert-4  20000000               110 ns/op
  BenchmarkHashIndexInsert-4      100000000               25.6 ns/op
  BenchmarkGoMapLookup-4  50000000                78.5 ns/op
  BenchmarkHashIndexLookup-4      100000000               17.7 ns/op
About 4x faster than Go's builtin map, for int32 key/value on both insert and lookup. And it allows any number of reader threads concurrent access with a writer without any synchronization or blocking, unlike Go maps. It doesn't allow zero keys, unlike go maps, and it doesn't allow deletes. Hardly apples to apples, but the performance of pure Go code is impressive nonetheless. 200 LOC, not counting tests.

Re: Why Go Is Not Good

#94
post #93

I just spent the weekend learning Go and writing a single writer multi-reader hashtable for threadsafe access. I picked it deliberately because it's against the philosophy of the language, which is to share by communicating instead of sharing data structures directly. It was painful to write: // Do NOT reorder this, otherwise parallel lookup could find key but see empty value atomic.StoreInt32((*int32)(unsafe.Pointer…

it allows any number of reader threads concurrent access without any synchronization or blocking, unlike Go maps.

You mean readers concurrent with a writer? AFAIK, any number of reader threads can get values out of a Go map when it isn't being written to.

Re: Why Go Is Not Good

#95
post #45
post #22

Earlier quoted context omitted.

In practice, Go has caused me less frustration than any other language I've used. I feel like the author's complaints here aren't really grounded in much experience, or maybe he's trying to use the wrong tool for the job. The author's conclusion: · Go doesn't really do anything new. · Go isn't well-designed from the ground up. · Go is a regression from other modern programming languages. is hardly sustainable. Go was…

> Tell me again that Go does nothing new for us. I do agree with the author here: Go the language does nothing new. Go the platform , on the other hand, is a really pleasant new experience when compared with other languages. The language is a regression in features compared to what other languages can do, but that is totally understandable when you look at what Go is aimed at.

Hmm, so some people are bent out of shape because of feature regression and over the fact that Go doesn't have the newest, shiniest gadgets. However, fans keep saying that their overall experience is great. Reminds me of something else...

Re: Why Go Is Not Good

#96
post #49
post #41

The author is using a sharp blade as his implication for good : features that make a language more complex. If the added complexity is "good" to you, then fine. In modern systems, simplicity is a powerful debugger. Adding all those features that the author talks about -- "Constraint-based Generics and Parametric Polymorphism", "Algebraic Types and Type-safe Failure Modes", and "Pattern Matching and Compound Expressio…

>In modern systems, simplicity is a powerful debugger. I don't consider the features I mentioned in this article to constitute "complexity". I think that Haskell is a beautifully simple language, in the same way that e.g. Euler's identity is beautifully simple. The reasoning behind it may be somewhat complicated, but the result is very simple (and impressive) to behold.

So why not just use Haskell? Why didn't Haskell take over Go's niche?

Re: Why Go Is Not Good

#97
post #93

I just spent the weekend learning Go and writing a single writer multi-reader hashtable for threadsafe access. I picked it deliberately because it's against the philosophy of the language, which is to share by communicating instead of sharing data structures directly. It was painful to write: // Do NOT reorder this, otherwise parallel lookup could find key but see empty value atomic.StoreInt32((*int32)(unsafe.Pointer…

it allows any number of reader threads concurrent access without any synchronization or blocking, unlike Go maps. You mean readers concurrent with a writer? AFAIK, any number of reader threads can get values out of a Go map when it isn't being written to.

Yes, concurrent with a writer. If there is more than one writer, the writers must use a mutex, but the single writer and readers don't block each other. I updated the text to make it clear.

Re: Why Go Is Not Good

#98
post #49

Earlier quoted context omitted.

>In modern systems, simplicity is a powerful debugger. I don't consider the features I mentioned in this article to constitute "complexity". I think that Haskell is a beautifully simple language, in the same way that e.g. Euler's identity is beautifully simple. The reasoning behind it may be somewhat complicated, but the result is very simple (and impressive) to behold.

So why not just use Haskell? Why didn't Haskell take over Go's niche?

Because Go is pretty good at its niche, and it has a huge amount of corporate support (from Google), which can make even a mediocre language seem very attractive.

Re: Why Go Is Not Good

#99
Reading this article and the HN comments made me realize, how people want to use the same language for everything. Unfortunately, this is not possible, since each language was design with certain use cases in mind. I too, am guilty of wanting a language to do everything, to be fast, memory efficient and also easy to program in.

Perhaps our ultimate quest in terms of designing languages is to design one smart enough that can be used to program toasters and clusters alike. Until then, we might as well use the right tool for the job.

Post reply on HN