Re: [go-nuts] shadowing of types by variables

2023-01-16 Thread Gorka Guardiola
Yes, I understood the idea from Brian's explanation. Makes adding new predeclared names (types, literals...) a compatible change. Thanks. On Tue, Jan 17, 2023, 04:03 Ian Lance Taylor wrote: > On Mon, Jan 16, 2023 at 5:46 PM 'wagner riffel' via golang-nuts > wrote: > > > > On 1/13/23 07:20, Gor

[go-nuts] Wait before Add

2023-01-16 Thread Богдан «bodqhrohro» Горбешко
The documentation explicitly states that it shouldn't be done if the WaitGroup counter is zero. Though I have occasionally written a code which does it, and it worked for several years, but weirdly, seems like the parallel execution of the critical section happens sometimes. The goroutine has a

Re: [go-nuts] shadowing of types by variables

2023-01-16 Thread Ian Lance Taylor
On Mon, Jan 16, 2023 at 5:46 PM 'wagner riffel' via golang-nuts wrote: > > On 1/13/23 07:20, Gorka Guardiola wrote: > > According to the spec it seems like it is legal to shadow a type with a > > variable, even a builtin type. > > Is there any specific rationale for this? I guess that it makes sco

Re: [go-nuts] shadowing of types by variables

2023-01-16 Thread 'wagner riffel' via golang-nuts
On 1/13/23 07:20, Gorka Guardiola wrote: According to the spec it seems like it is legal to shadow a type with a variable, even a builtin type. Is there any specific rationale for this? I guess that it makes scoping checks easier and faster, but still. I don't think there is any special rati

Re: [go-nuts] How to understand runtime.gogo?

2023-01-16 Thread Ian Lance Taylor
On Mon, Jan 16, 2023 at 8:43 AM j2gg0s wrote: > > As a newbie of golang's assembly, i cant understand why we MOVQ DX CX twice > in runtime.gogo. WHY? I don't see any MOVQ DX, CX instructions here. Can you clarify by saying exactly which instructions you are asking about? Note that MOVQ 0(DX),

[go-nuts] How to understand runtime.gogo?

2023-01-16 Thread j2gg0s
As a newbie of golang's assembly, i cant understand why we MOVQ DX CX twice in runtime.gogo. WHY? Source code: ``` 255 // func gogo(buf *gobuf) 256 // restore state from Gobuf; longjmp 257 TEXT runtime·gogo(SB), NOSPLIT, $0-8 258 MOVQbuf+0(FP), BX // gobuf

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2023-01-16 Thread 'Axel Wagner' via golang-nuts
On Mon, Jan 16, 2023 at 1:27 PM Bakul Shah wrote: > I would think the map iteration order is *arbitrary* but deterministic. > That is, the same set of keys will be iterated the same way every time. > If you would think that, you'd be wrong. The iteration order of a map is unspecified. But gc (th

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2023-01-16 Thread Bakul Shah
I would think the map iteration order is arbitrary but deterministic. That is, the same set of keys will be iterated the same way every time. This is not the case with the select statement. > On Jan 16, 2023, at 1:34 AM, 'Axel Wagner' via golang-nuts > wrote: > > I think the question of "when

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2023-01-16 Thread 'Axel Wagner' via golang-nuts
On Mon, Jan 16, 2023 at 3:18 AM Robert Engels wrote: > This is a very strange discussion. I don’t understand the purpose. > Malloc() isn’t even deterministic. Which means any arbitrary program can > take the address to generate entropy regardless of having time, etc > available. > > I didn’t look

[go-nuts] Re: Guaranteeing deterministic execution of Golang code

2023-01-16 Thread Brian Candler
Are you trying to find a pure functional subset of go? In a "pure function", the return value(s) are calculated only from the arguments. The result is not affected by the state of the system, and the state of the system is not affected by the function. That means you can't even do a print() in

[go-nuts] Re: etcd, how to stop it ?

2023-01-16 Thread alex-coder
Brian, I can't thank you enough ! Sorry, button "Community" ofcourse. понедельник, 16 января 2023 г. в 11:41:51 UTC+3, Brian Candler: > The homepage for etcd is here: https://etcd.io/ and there is a button > labelled "Community". > > You may also find this page useful: > http://www.catb.org/~

[go-nuts] Re: etcd, how to stop it ?

2023-01-16 Thread Brian Candler
The homepage for etcd is here: https://etcd.io/ and there is a button labelled "Community". You may also find this page useful: http://www.catb.org/~esr/faqs/smart-questions.html#intro On Sunday, 15 January 2023 at 18:30:09 UTC alex-coder wrote: > Hi All ! > > I do understand that my question