> Now, you might want to ... acquaint yourself with [dataflow variables and declarative concurrency] because [they are] the centre-piece of Go's language features. Not so. Go has native support for neither dataflow variables nor declarative concurrency. Go does have native support for message-passing concurrency--but that's different.
Why I Program in Go
71–80 of 171 posts
Re: Why I Program in Go
#72His second point is, to me, the most important for would-be language designers: Standardized formatting: A standard tool to enforce formatting rules that is not subject to change based on the team members' or leader's opinions is a welcome feature for lowering the "not my code" mental barrier. This is a godsend. The best thing to have happened to our industry since a very long time. But his first point is oversimplif…
Re: Why I Program in Go
#73We don't care you why program in Go.
EDIT: and dissent downvoted by google staff?
Re: Why I Program in Go
#74Earlier quoted context omitted.
It's not about commanding the GC. It's about avoiding unnecessary allocations.
OK, can you be specific how this is done? What is the technical reason here?
Relatedly, in Go if you allocate an array of n values of type T, the size of that array in memory is n * sizeof(T), and the items are laid out sequentially in memory. There are no other bookkeeping data structures and no indirection.
Here's a story about one project's struggle with data structures and Java: http://marc.info/?l=git&m=124111702609723
Relevant quote:
JGit struggles with not having an efficient way to represent a SHA-1.
C can just say "unsigned char[20]" and have it inline into the
container's memory allocation. A byte[20] in Java will cost an
*additional* 16 bytes of memory, and be slower to access because
the bytes themselves are in a different area of memory from the
container object. We try to work around it by converting from a
byte[20] to 5 ints, but that costs us machine instructions.
In Go, you would just write [20]byte. If you wanted a struct with a field of [20]byte you can do so, and all it costs is the 20 bytes.Re: Why I Program in Go
#75Earlier quoted context omitted.
My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…
You need to be commended for defending Go. I don't think the Go developers hide the fact that they mean go as a Systems level programming language. It has higher level features, but the developers don't really mind the fact that Go isn't going to be delivering a whole lot of high level features. Maybe if they come in the form of libraries... Funny thing about Go is that as a compiled language, folks often need to sen…
Not in my experience. Nearly everyone I know who deploys Go code does it by shipping a binary. One of the benefits of static linking.
Re: Why I Program in Go
#76His second point is, to me, the most important for would-be language designers: Standardized formatting: A standard tool to enforce formatting rules that is not subject to change based on the team members' or leader's opinions is a welcome feature for lowering the "not my code" mental barrier. This is a godsend. The best thing to have happened to our industry since a very long time. But his first point is oversimplif…
If the biggest gain for the language is a formatting utility then that language is not worth learning.
That you do not value those things as highly is not particularly profound. It doesn't mean that he is wrong to be excited about that, nor that he is excited about the wrong language, nor even that there is no reason for you to be excited about that language. It only means that there is no reason for you to be excited about that language for that particular reason.
Re: Why I Program in Go
#77Earlier quoted context omitted.
My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…
I have a hard time believing anything can beat or even match the garbage collection performance of the JVM. Not that there is something special about the JVM, just that there have been _so_ many smart people working on the problem for so long now. And for good performance doing server tasks (ie, not computational tasks) exceptional GC is a must. Can a GO program handle a workload that creates tens/hundreds of thousan…
Re: Why I Program in Go
#78His second point is, to me, the most important for would-be language designers: Standardized formatting: A standard tool to enforce formatting rules that is not subject to change based on the team members' or leader's opinions is a welcome feature for lowering the "not my code" mental barrier. This is a godsend. The best thing to have happened to our industry since a very long time. But his first point is oversimplif…
If the biggest gain for the language is a formatting utility then that language is not worth learning.
They made some very opinionated choices and have largely stuck by them. You can't have an unused variable, it just won't compile. What a pain, right? Well, if there's one thing I've learned from compiling open source code, it's that you CANNOT trust programmers to clean up their code before releasing it--just play "count the unused variable warnings" next time you compile pretty much any Linux program.
Re: Why I Program in Go
#79Go nails code readability and documentation better than any other language I'm aware of. For example, look at the package documentation for Go's list data structure at http://golang.org/pkg/container/list/ . 5 seconds of reading this you immediately get what the package does and how to use it. Now let's say you want to know how the list is implemented. No problemo. Click the package files link list.go, http://golang.…
That's because you haven't seen PHP's documentation.
Look at your Go's list example.
It doesn't even show how to create a list and fill it with items.
It doesn't have users' comments.
It doesn't explain much about the data structure. Can it be a circular doubly link list, for instance?
Is there a method to empty the list, or quickly insert more than one element?
Instead it has strangely named sections (like "type Element") that aren't obvious to somebody new to the language.
Sorry, but this documentation is shit.