This proposal makes sense to me. 

Disclaimer: 
I don't know enough about language design to provide feedback on how it may 
be refined. This is just my perspective as a potential future user.

   1. It is one of the simplest proposals I've read so far (but I have not 
   read them all - there are too many to keep up with)
   2. It is easy to understand and visualise where it would be used
   3. It is orthogonal - it does not tread on the capabilities of other 
   keywords, but complements them nicely
   4. In conjunction with the "gen eq" and "gen num" keywords, it would be 
   sufficient for all the work I've needed to do



On Friday, May 31, 2019 at 4:29:03 AM UTC+12, Michal Strba wrote:
>
> Hi Gophers! :)
>
> I've been thinking about generics in Go 2 ever since the original 
> contracts proposal and few days ago, ideas finally clicked. One of the main 
> things about this proposal is that it deliberately omits the ability to 
> restrict the set of types a function can work with. This is a limitation, 
> but I hope to convince you that we can still do a vast majority of the 
> things we were missing, when we were missing generics. 
>
> I'd love to share my proposal with you and engage in a good faith 
> conversation.
>
> Link to the proposal. 
> <https://gist.github.com/faiface/e5f035f46e88e96231c670abf8cab63f>
>
> Here's what the proposal covers:
>
> 1. Syntax of a new gen keyword.
> 2. Generic functions.
> 3. Unnamed generic arguments (a.k.a. a way to gve a type to the built-in 
> new function).
> 4. Semantics of generic values (ability to use them as map keys, ...).
> 5. Generic array lengths.
> 6. Reflection and interface{}.
> 7. Generic types (with two examples: List and Matrix).
> 8. Generic methods and their limitations due to reflection.
> 9. Generic interfaces.
> 10. List of things this proposal can't do.
>
> Thanks,
> faiface
>

-- 
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/291fced4-873d-454f-9a23-49375cd5be6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to