Skip to content

Instantly share code, notes, and snippets.


Andrew Price aprice2704

  • BC, Canada
View GitHub Profile
aprice2704 /
Last active Dec 5, 2018
FRI Generics for Go (golang) Proposal

FRI Go Generics Proposal

Here is my whack at a proposal for how Generics might look in Go.

I think generics should be mechanism for re-using tested, optimized code and for increasing readability of source, not for saving developers a few keystrokes, or fulfilling their desire to write things that look like equations.

Therefore I do not propose overloading operators (or anything much actually), indeed I actively oppose allowing it.

Also, I think compile-time polymorphism (use any type that works, as long as you know what it is at compile time) is more important than run-time polymorphism (use multiple different types in the same structure and iterate over them letting the run-time call the right method for each type).