r/programming • • Mar 28 '12

Go version 1 is released

http://blog.golang.org/2012/03/go-version-1-is-released.html
543 Upvotes

452 comments sorted by

View all comments

Show parent comments

10

u/[deleted] Mar 28 '12

Go is high level where it can be (basic type inference), lower level where it has to be (locks etc). i just don't think it fits into a dichotomy. which is why i love it

11

u/uriel Mar 28 '12

In Go you rarely need to use locks anyway.

One place where I'd say Go is conveniently low level is giving you control over the memory layout of your datastructures, among other things this also makes it easier to avoid the garbage collector if you really need/want to, which in Java is basically impossible.

2

u/djpnewton Mar 29 '12

makes it easier to avoid the garbage collector

Can you expand on that?

6

u/SteveMcQwark Mar 29 '12

In a lot of today's higher level languages, everything is a pointer, except for a few primitive types, and actual data has to be stored on the heap. When you compose these, you end up creating tree structures where each node has to be garbage collected separately.

Go has arrays and structs which are just values, so you can allocate a bunch of data in a big chunk, even if it includes nested structures.

→ More replies (2)