Design

Generics For Go

A design that adds generic functions and types.

(Obviously for Go 1.17.) Why you might find this approach interesting: Type variable declarations are implicit Type arguments for functions are implicit Type variable constraints can be omitted for the empty interface Methods can be generic Operations are represented with generics as normal methods It can simplify the Go language specification Check out the More ideas section at the end for things beyond generics. Define comparison operations for all types For the types that don’t yet have them:

Design · Generics · Go · Languages · Technology · Types

Will Faught

28 minutes

π