Go Generics Facilitators

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

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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.

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • 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.

  • 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

  • Go streams (a look at what is possible with generics)

    3 projects | /r/golang | 18 Mar 2022
  • FYI: pkg.go.dev doesn't show packages with generics

    2 projects | /r/golang | 29 Dec 2021
  • [go1.18beata1] Bug while runnings package tests on generic code

    3 projects | /r/golang | 25 Dec 2021
  • Go proposal: finite type set interface as union type

    1 project | news.ycombinator.com | 10 Dec 2024
  • Good union types in Go would probably need types without a zero value

    3 projects | news.ycombinator.com | 8 Dec 2024

Did you konow that Go is
the 4th most popular programming language
based on number of metions?