The correct language-level solution to #4 is to introduce generics and to allow generic type parameters to have interface bounds. That would solve the problem without having to introduce variance.
Go's slices are generic to the extent needed, and the subtyping of Go's interfaces fits the requirements for ordering of types well enough.
Edit: I don't know go, but if slices give write access, I think the automatic conversion the author wants would be unsound.
(For what it's worth, I'm not sure I would bother solving this problem if I were suddenly put in charge of Go's design, given Go's extreme aversion to type system features. I'm just describing what the solution to this problem typically is.)
> • an identifier
> • an integer, floating-point, imaginary, rune, or string literal
> • one of the keywords break, continue, fallthrough, or return
> • one of the operators and delimiters ++, --, ), ], or }
The things you can put as elements of a slice, values of a map, or values in a struct literal are Expressions nonterminal symbols (https://golang.org/ref/spec#Expression). As far as I can tell, the tokens that can end an Expression are a subset of those after which semicolons can be automatically inserted.
On 1 I'll just say it'd be nice if append (and other varargs functions) could take multiple of individually listed and slice-expanded args at the same time. As in: `append(a[:2], 3, a[2:]...)`. I already expect append to be O(n), and this would be some very nice sugar.
1. How often do you insert into a slice? You know that's a O(n) operation, right?
2. nil is typed, I'll grant that it's not the most obvious part of Go's type system.
3. Meh.
4. This is type covariance. It's complicated and hard to get right. The Java Generics FAQ looks like this: http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.ht...
5. I like by-value loops. Everything else in Go is by-value.
6. Yeah, fuck everything we know about parsing, let's make whitespace significant, then we can declare slices like:
7. Meh