News for hackers. Stuff that matters.
Re:I’m joining the Go team at Google by weberc2 on Friday September 23, 2016 @11:34AM (#12565371)
> You don't have control over what goes on the stack/heap

You do have this control. There is escape analysis, but I've never had to dance with it to make it put things on the stack when I need them to. I can get very close to C speeds with Go without much effort.

Re:I’m joining the Go team at Google by pcwalton on Friday September 23, 2016 @12:19PM (#12565737)
In that sense, Java and C# both have control too.

There are lots of cases in which escape analysis falls down. In particular, higher order control flow (closures/interfaces) will always cause it to fail, until Go implements some sort of higher order control flow analysis (which I doubt it will). Go uses interfaces a lot.

Re:I’m joining the Go team at Google by weberc2 on Tuesday September 27, 2016 @09:50AM (#12589553)
C# doesn't have escape analysis, but it has stack-allocated value types. Java doesn't have stack-allocated value types (yet), but it has escape analysis. It seems a lot harder to me to reason about escape analysis without value types, and I have no idea what happens in C# if you take a reference to a value type (i.e., is it moved to the heap?).

I never meant to imply escape analysis was somehow perfect; only that it is (mostly) easy to reason about.

Re:I’m joining the Go team at Google by vvanders on Friday September 23, 2016 @11:40AM (#12565420)
Can I say X is a value-type(or better annotate it in declaration)? If not then I don't have that control.

Your compiler doesn't know your data access patterns, dataset size or a myriad of other factors that you need to tune if you really want to get full utilization from your hardware. To be clear I'm talking about ~5% of software out there, but when you need it you really need it.

Re:I’m joining the Go team at Google by _ph_ on Friday September 23, 2016 @12:48PM (#12565996)
Yes, the distinction between value and pointer types is explicit in the language, so you have all the control. This is, why you also have more control about the memory layout than in Java, which makes a huge difference in performance.
Re:I’m joining the Go team at Google by pjmlp on Saturday September 24, 2016 @02:51PM (#12572052)
For the time being, until Java 10 gets released.

But how things are going regarding Java releases, Go could even get generics before Java 10 gets released.

Re:I’m joining the Go team at Google by weberc2 on Tuesday September 27, 2016 @09:52AM (#12589563)
Yes, it has value and pointer types, just like C (except without pointer arithmetic).