News for hackers. Stuff that matters.
Re:Dart language by ootachi on Monday October 10, 2011 @12:07PM (#3094368)
I assume you mean "any lvalue"? You can't take the address of rvalues, can you?
Re:Dart language by enneff on Monday October 10, 2011 @05:59PM (#3096061)
Go doesn't define "lvalues," in the spec, but it does define "addressability." My comment would be more accurate if I had said "Go lets you take the address of any value in memory." (stack or heap)
Re:Dart language by jganetsk on Monday October 10, 2011 @07:35PM (#3096363)
I don't think Go lets you take stack addresses. If you try to do that, it will copy the data structure onto the heap.
Re:Dart language by enneff on Monday October 10, 2011 @07:45PM (#3096394)
The compiler is free to optimize this how it sees fit. Taking the address of a value doesn't necessarily move it to the heap.
Re:Dart language by jganetsk on Tuesday October 11, 2011 @11:45AM (#3099045)
I imagine this optimization can only happen once escape analysis is performed. In the general case, address-of moves the data to the heap, or causes it to be stored on the heap in the first place. Correct?
Re:Dart language by enneff on Tuesday October 11, 2011 @07:07PM (#3100810)
Yes.