358 points · by enneff · 12y ago · 108 comments
"Because concurrent Go programs use channels to pass not just values but also control between different goroutines, it is natural when reading Go code to want to navigate from a channel send to the corresponding receive so as to understand the sequence of events.
Godoc annotates every channel operation—make, send, range, receive, close—with a link to a panel displaying information about other operations that might alias the same channel."
Understanding large concurrent programs is significantly easier with a precise pointer analysis to help you track objects.
I still can't tell if it's evolved beyond a mark-and-sweep - I have to assume no - we've heard the GC would be seeing improvements and that the current (now older) method was stop-gap.
>> The garbage collector has been sped up, using a concurrent sweep algorithm, better parallelization, and larger pages. The cumulative effect can be a 50-70% reduction in collector pause time.
"The net/http package now provides an optional Server.ConnState callback to hook various phases of a server connection's lifecycle (see ConnState). This can be used to implement rate limiting or graceful shutdown."
Knows anyone here a code example for this?
When you have multiple libraries you have to be very specific about when you run godep, lest you find yourself with two libraries needing different versions of a common library, for example Main imports Foo and Bar, which both import Baz. Godep provides a mechanism for handling this: each dependency is explicitly locked into a fixed revision (e.g. commit sha, in the case of git). The pain comes about when during debugging as it can be very hard to reason which version of a library you're using.
Additionally the revision aspect is also a bit of a PITA, we use a development flow which rebases our small commits into a big commit and then merges that into our master branch; if you ran godep prior to that you're now referencing a commit that no longer exists. Given the chain of references that can exist this can go a very long way down. This same pattern also forces you into needing to push your dev branches to an origin server, as godep checks out the repos during the build, which while pretty benign a concern is a PITA if you forget and your build breaks because of it.
We're strongly considering moving to "one big repo" to help combat this issue (as well as a few others) for our internal golang repositories. Referencing "published commits" in 3rd party libraries is an acceptable level of pain. We're not entirely sold on this yet... just considering it.
It seems to be a solution for some (not all) projects that are released in binary form, but that isn't relevant to most projects out there[0]. I have never felt the need for what godep provides; vendoring myself has been sufficient for the (very rare) case in which I need specific versions of dependencies other than tip/trunk.
I asked around on #go-nuts, and (though the sample size was small), the other regular contributors who idle in the channel seemed to have the same experience.
YMMV obviously.
[0] https://botbot.me/freenode/go-nuts/2014-06-19/?msg=16563763&...
"Cross compiling with cgo enabled is now supported. ... Finally, the go command now supports packages that import Objective-C files (suffixed .m) through cgo."
Great news!!!!!!!!!!!!!!!!!!!!
This makes me really happy. I end up writing a lot of bindings to C libraries (libjpeg, libpng, etc), some of which use incomplete types to hide the contents of their internal structs. With this fix I'll finally be able to work within the constraints of the typesystem and stop hacking around it with casts to/from unsafe.Pointer.
warning: GOPATH set to GOROOT (T:\Tools\Go) has no effect
go build runtime: windows/386 must be bootstrapped using
make.bat
So, if you installed Go in a different directory, ignore the Windows environment vars "PATH" entry and just execute the "make.bat" in the "Go\src\" directory - the first time.1. String concatenation (Go has it) 2. Matrix/vector operations
That's it. Any other use case for operator overloading is dubious at best. It sucks for scientific programmers, but Go is a general purpose language, not a Scientific Programming language.
Complicating parsers, the grammar, readability, all those things, just to please your sub-group -> no thanks.
Operator overloading has absolutely no effect on the parser or grammar.
It may harm readability but that's more a question of naming. An operator is just a name. If you use that name to refer to something unexpected, you'll harm readability. If you use it for something intuitive, you'll improve it.
In the case of FORTRAN it is because the vector and matrices are recognized types, in other language, they are not built-in types but the convenience is added thanks to operator overloading.
I like Go a lot, but Google switching to it for Android would probably have the opposite effect. Many people learn Java in school. Almost no one learns Go.
- it isn't a priority
- it is a tricky thing to get right in the context of Go
- there haven't been any satisfactory proposals thus far
If this isn't quite right I'd love to be corrected.
In the meantime there have been several satisfactory proposals (in the lists and elsewhere), and it's not like 200 other languages implementing Generics have had many issues with them.
So, it boils down to the Go core team putting up the solution to an impossible tradeoff as the holdback (and a little exagerrated one at that, with relation to the costs involved).
And then, they said "the language won't change" etc recently.
non-static typing is a massive loss of safety.
It's the "nice to have" things that make programming easier/more correct/better.
Edit: I'm kind of hoping "But does it have generics?" will become the new "Will it blend?" for golang discussion.
One of the reasons I like HN.