logoalt Hacker News

afioritoday at 5:31 AM0 repliesview on HN

https://www.ralfj.de/blog/2025/07/24/memory-safety.html

Go is by default not thread safe. Here the author shows that by looping

    for {
        globalVar = &Ptr { val: &myval }
        globalVar = &Int { val: 42 }
     }
You can create a pointer with value 42 as the type and value are two different words and are not updated atomically

So I guess go is easier to write, but not with the same level of safety