‹ BackHN Continuity

Thread

Platform-independent SIMD in Go

414 points · 152 comments · yurivish

  1. u8 · · focus · HN ↗
    This is why I love Go. Nobody was asking for this, but they took the time to do it right and continue to Push go as a memory safe, high-level systems language.
    1. OutOfHere · · focus · HN ↗
      (removed)
      1. shikck200 · · focus · HN ↗
        You can write unsafe code in Go (import unsafe), but then, you can do the same in Rust. Unsafe code is not the default, and in day to day Go i rarely see the use of the unsafe package.
        1. iambvk · · focus · HN ↗
          What he probably means is data-races in go can result in memory/type unsafe accesses -- I suspect, likely due to slice types -- not sure if that is true/false.
          1. shikck200 · · focus · HN ↗
            Sure, but a data race is, IMHO not the same as memory safety. A data race, can be 100% memory safe, but just cause a logic bug in some program. I often see people mixing memory safety with racing. Go has bounds checks so you end up with a panic either way. Not UB.

            As an (outside go) example, Ocaml (5) promises strong memory safety, but not to be data race free. A data race is not something we can prevent, because its usually not bound by code, but by time and the race-source rarely in source-code.

            This means we have data races in http, database inserts etc. The source is usually not a concurrent task in source code-land.

            1. speedstyle · · focus · HN ↗
              Races can be memory safe (they are in Java and Ocaml), but in Go they can indeed cause UB.

              <a href="https:&#x2F;&#x2F;go.dev&#x2F;ref&#x2F;mem#restrictions:~:text=such%20races,corruption" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;ref&#x2F;mem#restrictions:~:text=such%20races,corr...

              <a href="https:&#x2F;&#x2F;www.ralfj.de&#x2F;blog&#x2F;2025&#x2F;07&#x2F;24&#x2F;memory-safety.html" rel="nofollow">https:&#x2F;&#x2F;www.ralfj.de&#x2F;blog&#x2F;2025&#x2F;07&#x2F;24&#x2F;memory-safety.html (I don&#x27;t agree with everything here, but it&#x27;s a very thorough explanation)

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.