That being said it would be really nice to have some reusable map type structures that handle GC better than the default maps. Fingers crossed.
A Proposal for Adding Generics to Go
11–20 of 273 posts
Re: A Proposal for Adding Generics to Go
#12I mean, seriously,
func F[T any](p T) { ... }Re: A Proposal for Adding Generics to Go
#13- https://news.ycombinator.com/item?id=20576845 (2019 draft)
- https://news.ycombinator.com/item?id=20541079 (also 2019 draft)
- https://news.ycombinator.com/item?id=23543131 (2020 draft, i.e. the base version of the current draft)
Re: A Proposal for Adding Generics to Go
#14I hope at some point they manage to add it. I, however, discovered Rust in the meanwhile. It has generics. And it is not too complex either and has quite a few other bonuses.
Re: A Proposal for Adding Generics to Go
#15every language designer who does not understand c++ is doomed to reinvent it I mean, seriously, func F[T any](p T) { ... }
Re: A Proposal for Adding Generics to Go
#16We have a very large Go codebase here at Stream and not having generics is just not really as big of an issue as you think it is. There are plenty of work arounds if you get used to not having generics in the language. The fast compile times of Go are amazing. I was doing some Kotlin a few weeks ago and the difference is crazy. Go: Install deps, compile everything done in 5s. Doing the same in Kotlin, laptop freezes,…
Generic map/reduce on slices wouldn't hurt too.
OTOH, it's 2021 and look at what we are wishing. My love/hate relationship with golang is like the one I have with Apple.
Re: A Proposal for Adding Generics to Go
#17As much as I've cursed the lack of generics and the limited expressiveness of Go's type system, it's hard for me to reconcile these proposals with what I know of Go. Go was conceived as a small language, a successor to C, and purposely eschewed "new-fangled" features of modern languages. Whether the result is good is a matter of taste, but I feel that retroactively bolting on a modern type system will simultaneously…
Re: A Proposal for Adding Generics to Go
#18As much as I've cursed the lack of generics and the limited expressiveness of Go's type system, it's hard for me to reconcile these proposals with what I know of Go. Go was conceived as a small language, a successor to C, and purposely eschewed "new-fangled" features of modern languages. Whether the result is good is a matter of taste, but I feel that retroactively bolting on a modern type system will simultaneously…
Simplicity: yes, but in a senseful manner. Omitting generics is not senseful to me.
Re: A Proposal for Adding Generics to Go
#19I hope at some point they manage to add it. I, however, discovered Rust in the meanwhile. It has generics. And it is not too complex either and has quite a few other bonuses.
Re: A Proposal for Adding Generics to Go
#20Another comment mentions this is the third (serious) attempt at adding generics to Go. Is there any concise history of these attempts (including this one)? I'd like to understand the gist of these proposals and what ultimately derailed them. By themselves these proposals are pretty inscurtable.