Go Generics Facilitators

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • generic

    A collection of generic data structures written in Go.

  • I recently saw a go generic data structures library in the wild: https://github.com/zyedidia/generic.

    Anyone have any more? I'm curious what people come up with for goroutines/channels.

  • async

    experimental promises in go1.18 with generics (by nkcmr)

  • I made this: https://github.com/nkcmr/async so I can experiment with the idea of Promises in Go. Keep in mind it's experimental and I've only lightly played around with the pattern.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • go

    The Go programming language

  • > Go will not inline a function that exceeds complexity metrics

    True, but:

    > and one of those metrics is whether the function contains a range statement. You will get a real heap-allocated closure invocation on each loop.

    I think this is no longer true in Go 1.18, see https://github.com/golang/go/issues/14768#issuecomment-98175... .

  • functools

    Functional tools in Go 1.18 using newly introduced generics

  • fut

  • Undocumented early impl/design of futures: https://github.com/cretz/fut

  • gods

    Go Data Structures (by johan-bolmsjo)

  • I've just finished porting my gods module (Go Data Structures) to make use of generics.

    https://github.com/johan-bolmsjo/gods/tree/v2

    It's not much, only a simple list and an AVL tree that I've carried with me for many years. Binary search trees are useful to solve some problems because they are ordered.

    I was impressed with how polished the tools where. The go-lsp plugin just worked with the new generic types. I solved all compiler errors in the editor without actually compiling anything. Did not expect that level of polish. The modules introduction broke the editor integration for many release cycles. This seems much smoother.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts