Re: [go-nuts] The feature I want most, weak *

2017-02-13 Thread 'Axel Wagner' via golang-nuts
You can already achieve all of this without any kind of language change or cooperation from the go-team. Just add an annotation in a comment (e.g. "//foo:weak") on declarations of "weak" pointers and then have the tool look for them and do its analysis. On Mon, Feb 13, 2017 at 12:18 PM, Keynan

Re: [go-nuts] The feature I want most, weak *

2017-02-13 Thread Keynan Pratt
""" But once you start saying that we are going to reject storing nil in an interface value unless it is weak, then you are greatly complicating the type system. """ With regards to controls on nil this is a static analysis tool, not something I expect to be forced on anyone. As I understand it

Re: [go-nuts] The feature I want most, weak *

2017-02-12 Thread Ian Lance Taylor
On Fri, Feb 10, 2017 at 10:04 PM, Keynan Pratt wrote: > Yes it CAN be implemented that way, but that throws away type information, > and makes code less readable. The question of compile-time type information boils down to the generics issue. > It also seems to conflate

Re: [go-nuts] The feature I want most, weak *

2017-02-11 Thread Wojciech S. Czarnecki
Dnia 2017-02-11, o godz. 17:04:58 Keynan Pratt napisał(a): > On the other hand what is the cost of adding this? > I suspect it is (very) small I suspect it is (very) easy to assess: simply clone the go repo and do implement weak as you sketched it. See e.g.

Re: [go-nuts] The feature I want most, weak *

2017-02-10 Thread Keynan Pratt
Yes it CAN be implemented that way, but that throws away type information, and makes code less readable. It also seems to conflate the difference between language and library, i suppose go has already trod that bridge. What I'm asking for is something that can be used to reason about programs at

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread Ian Lance Taylor
On Thu, Feb 9, 2017 at 4:46 PM, wrote: > > I'll look into that api and maybe it will solve my problems. Though, to be > understood I'm not asking for ARC, I'm asking for a keyword so the spec is > compatible with ARC. But you don't need a keyword to get weak pointers.

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread Andy Balholm
I expect you’re just left with the option of magic comments then, since there’s not going to be much enthusiasm for adding a new do-nothing keyword to the language. Andy -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread andrey mirtchovski
> Maybe you could use “notwithstanding". It’s an ignored token in the default > Go compiler, and a weak pointer is one that allows an object to be freed > notwithstanding any weak references to it… these are gone now: https://twitter.com/rob_pike/status/808784925402898432 -- You received this

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread Andy Balholm
Maybe you could use “notwithstanding". It’s an ignored token in the default Go compiler, and a weak pointer is one that allows an object to be freed notwithstanding any weak references to it… It’s not in the spec, though, so it might cause problems with other Go implementations such as gccgo.

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread kpratt
I'll look into that api and maybe it will solve my problems. Though, to be understood I'm not asking for ARC, I'm asking for a keyword so the spec is compatible with ARC. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread kpratt
Thx, that looks like an interesting paper. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread Ian Lance Taylor
On Thu, Feb 9, 2017 at 1:26 AM, wrote: > The feature I want most in go is automatic reference counting. I don't > really care how mainline GC works but I want the language to be open to the > possibility of ARC-GC. In order for that to be able to handle cycles you > need a

Re: [go-nuts] The feature I want most, weak *

2017-02-09 Thread Jesper Louis Andersen
What is your use case? The advantage of a GC over something like ARC is that you avoid having to worry about cycles in the heap. Recent GC work has reduced the traditional weakness of Tracing GCs--pauses--into a minimum (reports is 10 microseconds), so the need might not be there. There is a

[go-nuts] The feature I want most, weak *

2017-02-09 Thread kpratt
The feature I want most in go is automatic reference counting. I don't really care how mainline GC works but I want the language to be open to the possibility of ARC-GC. In order for that to be able to handle cycles you need a weak_ptr type that can requires explicit graduation to a shared_ptr.