4 ms·
> the maps are generic in the same way that they already are in Go. Go maps are actually not generic in the same way they are in other languages, there is just
by ibraheemdev 5y ago
> the maps are generic in the same way that they already are in Go.
Go maps are actually not generic in the same way they are in other languages, there is just a single map struct with type descriptors used to do some compiler magic: https://dave.cheney.net/2018/05/29/how-the-go-runtime-implements-maps-efficiently-without-generics https://dave.cheney.net/2018/05/29/how-the-go-runtime-implem...
- deleted 5y ago[deleted]
- cle 5y agoYes I'm aware that there are differences, but it's not clear to me how that's relevant.
- ibraheemdev 5y agoWell you said "maps are generic in the same way that they already are in Go", which I took to mean that Go already has monomorphized generics under the hood, they just aren't exposed publicly.
- cle 5y agoI'm specifically talking about the subset of ways in which they are similar and also relevant to this scenario of handling arbitrary structured data like JSON. There are of course ways in which they are not similar, but I'm not sure how those are relevant to this scenario being discussed....could you elaborate on that?