‹ 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. nonethewiser · · focus · HN ↗
      This is kind of the opposite of Go. Not giving people what they are asking for.

      There are pros and cons of course. You don't have 17 different ways to iterate over an array, so that's nice. But you also went 13 years without generics, despite them being one of the most requested features, because the designers didn't want that complexity inside Go.

      Overall I think Go is better for this philosophy but there are times where the language is clearly written more for its maintainers than it's users.

      1. sa46 · · focus · HN ↗
        > But you also went 13 years without generics

        Go shipped with generics (aka bounded parametric polymorphism), but only for built-in types: slices, arrays, and maps. That, with subtyping via interfaces, handled most demand for generics. The most common pain point was custom containers.

        Go was first released in November 2009. Russ Cox posted "The Generic Dilemma" [1] in December 2009. The comments show the generics debate raging from the earliest days.

        As a fun side note, I forgot I posted a comment on that post pointing to Ada's generics. I was in college, and Ada was our intro language.

        [1]: <a href="https:&#x2F;&#x2F;research.swtch.com&#x2F;generic" rel="nofollow">https:&#x2F;&#x2F;research.swtch.com&#x2F;generic

        &gt; the designers didn&#x27;t want that complexity inside Go.

        Yes, with some nuance. Go&#x27;s goal of writing server programs didn&#x27;t require the type-system complexity and run-time hit of user-defined generics. [2]

        &gt; Go was intended as a language for writing server programs [...] Polymorphic programming did not seem essential [...] so was initially left out for simplicity. &gt; &gt; Generics are convenient but they come at a cost in complexity in the type system and run-time. It took a while to develop a design that we believe gives value proportionate to the complexity.

        [2]: <a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;faq#beginning_generics" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;faq#beginning_generics

        Out of curiosity, I collected all proposals for Go&#x27;s journey to generics. <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;jschaf&#x2F;eaa7aff1af14ea7276a18a1b7370d7a4" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;jschaf&#x2F;eaa7aff1af14ea7276a18a1b7370d...

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.