logoalt Hacker News

Go: Support for Generic Methods

123 pointsby f311atoday at 9:02 AM104 commentsview on HN

Comments

xenatoday at 5:26 PM

This will finally let me make the monad library I've been dreaming of for years. Be afraid.

show 1 reply
nasretdinovtoday at 1:22 PM

Lack of generic methods was really surprising to me when I was first trying to use generics in Go. Nice to see it being actually implemented

show 1 reply
kardianostoday at 1:08 PM

This is great. Will be useful for data access methods!

As for the detractors, from the first generics proposal this was called out as a "not now", not never. There were questions of implementation. They aren't a super large team, and they try to do things incrementally and do them well.

show 2 replies
h1fratoday at 12:36 PM

slowly implementing all the things they said we didn't need

show 5 replies
mackrosstoday at 3:26 PM

What a happy surprise today! The amount of times I’ve had to do weird janky package APIs so the API was still reasonable is more than I can count.

reactordevtoday at 1:35 PM

This resolves a big gap in generics for most people coming from other languages to go so I completely approve this direction. Not saying use it everywhere but if you must use it, it’s better to have it on the struct than call a module level generic func.

sambertoday at 2:18 PM

OMG. I'm going to recode some of my libraries.

binary132today at 1:48 PM

Chasing a perceived gap between language features and user expectations has been and continues to be the greatest error in the leadership of Go.

show 1 reply
throwpikerobtoday at 2:07 PM

A sad day for Go, the pHDs have won, simplicity has died.

show 2 replies