Constraining Go type parameter pointers
A quick note on an FAQ about Go generics
A quick note on an FAQ about Go generics
A supplementary post to my GopherConAU 2023 talk of the same title.
I describe four ways to express constraints for operators in generic Go code and the trade-offs involved.
I try to explain why the problem of calculating the exact contents of a type set in Go is harder than it might seem on the surface.
Go’s Context.Value is controversial because of a lack of type-safety. I design a solution for that based on the new generics design draft.
I provide a very high-level overview of what Go-the-language means vs. Go-the-ecosystem vs. Go-an-implementation. I also try to provide specific references to what documentation is most useful for what purpose.
Roughtime can be (ab)used for Trusted Timestamping. I wrote a simple tool as a PoC
I describe a way to simplify the generics design. The ideas are not particularly novel and have been expressed to various degrees by other people as well. I hope to provide a more complete view of the design though.
I explain what co-, contra- and invariance are and what the implications for Go’s type system would be. In particular, why it’s impossible to have variance in slices.
I present a couple of patterns that help modelling persistent datastructures in Go. I also apply them to three examples.