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

2025-05-26 Thread Robert Engels
Not my observation - it’s in the Go docs :)On May 26, 2025, at 2:51 PM, Jason E. Aten wrote:Interesting observation, thanks Robert!  I'll have to think about that more.Off the cuff, I don't think they mutually exclusive. Randomness might benefit liveness properties too/not just a safety ones.On M

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

2025-05-26 Thread Jason E. Aten
Interesting observation, thanks Robert! I'll have to think about that more. Off the cuff, I don't think they mutually exclusive. Randomness might benefit liveness properties too/not just a safety ones. On Monday, May 26, 2025 at 12:58:17 PM UTC+1 Robert Engels wrote: I am pretty sure that isn

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

2025-05-26 Thread Robert Engels
I am pretty sure that isn’t correct. You can still easily create deadlocks. The reason it is random is to avoid channel starvation. On May 26, 2025, at 2:09 AM, Jason E. Aten wrote:Since I've been researching reproducible simulation testing recently, andthinking about how to maximize determinism,

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

2025-05-26 Thread Jason E. Aten
Since I've been researching reproducible simulation testing recently, and thinking about how to maximize determinism, I was reading this two year old thread. I had a "lightbulb over the head" moment. I realized _why_ Go's select statement, from CSP, from Dijkstra's guarded commands, is specifie

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

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

2023-01-15 Thread Robert Engels
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 it up, but I’m pretty sure there is a “law” that if the langu

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

2023-01-15 Thread 'Axel Wagner' via golang-nuts
On Mon, Jan 16, 2023 at 12:38 AM Stan Srednyak wrote: > hi Axel, > > thanks for sharing. Why did you mention webassembly specifically, why not > go or c? > I mentioned WebAssembly specifically because a) it has a well sandboxed, single-threaded VM and b) there are existing compilers for Go. I do

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

2023-01-15 Thread Stan Srednyak
hi Axel, thanks for sharing. Why did you mention webassembly specifically, why not go or c? Stan On Sat, Jan 14, 2023 at 6:37 PM Axel Wagner wrote: > Oh, also, fmt: https://go.dev/play/p/xxOw3vqWR4u (probably need to run > this offline) > > Honestly, I don't think there really is a practical w

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

2023-01-15 Thread Kevin Chowski
Sorry, I should have read Axel's blogpost before posting. I enjoyed reading it, thanks for sharing :) some of what I was talking about is covered with more code examples in the post. On Sunday, January 15, 2023 at 1:03:50 PM UTC-7 Kevin Chowski wrote: > I think a little more background about t

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

2023-01-15 Thread Kevin Chowski
I think a little more background about the context of the question would be helpful. Determinism may mean different things in different situations depending ont he guarantees you need. Also, did you know that the go playground (play.golang.org) is intended to be generally deterministic so that

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

2023-01-14 Thread 'Axel Wagner' via golang-nuts
Oh, also, fmt: https://go.dev/play/p/xxOw3vqWR4u (probably need to run this offline) Honestly, I don't think there really is a practical way to prevent non-determinism without severly hampering the language. Your best bet is probably to compile a program to webassembly and then don't give the VM a

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

2023-01-14 Thread 'Axel Wagner' via golang-nuts
There's also maps, select and goroutines in general. Funnily enough I blogged about this some years ago, for fun . On Sat, Jan 14, 2023 at 11:52 PM Stan Srednyak wrote: > How much of Golang functionality must b