Hi everyone,

I noticed today the blog post about the revised Generics proposal.  What 
got me excited is this extract at the start:

*The biggest change is that we are dropping the idea of contracts. The 
difference between contracts and interface types was confusing, so we’re 
eliminating that difference.*

To me the lack of orthogonality between contracts and interfaces was the 
major issue with the previous proposal and I have been musing with ways of 
resolving it for a while, so I am very pleased that the proposal is going 
down this path!

Last month I decided to write a post about a way of introducing Generics 
into Go using interfaces,  which I called "Package Specialization".

Headline features are:

   - *use interfaces to express parametric types*;
   - no new keyword;
   - the only new syntax is “package specialization”: pkg(T=int, 
   Y=*MyType).Func();
   - generic code which doesn’t use the package specialization syntax is 
   already valid Go.

The full post can be read here: 
https://arnodel.github.io/marooned/go/generics/2020/06/06/go-spec2.html

I was toying with the idea of submitting it here for feedback, to try to 
move the discussion in that direction.  Well, I guess today's updated 
proposal steals my thunder! Essentially this is the same idea, but with a 
different manifestation in the language - I thought that submitting it 
anyway may provide a useful comparison point to help gauge the updated 
proposal better.

Note that sadly, I do not have much time to polish a proposal or to follow 
discussions in general on this or other golang-related discussion lists, so 
I apologize in advance if I am inadvertently re-hashing ideas that have 
been put forward and dismissed in the past, or if my blog post is a little 
low on detail (it was meant to be an exploration of a possible approach).

Kinds regards,

Arnaud Delobelle

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d47d543e-1ac0-4145-ab4a-11c20aea462bn%40googlegroups.com.

Reply via email to