4 ms·
> how do core data structures like hash maps work without generics blessed implementations inside the language, slices, maps and channels are built in generics
by meditative 6y ago
> how do core data structures like hash maps work without generics
blessed implementations inside the language, slices, maps and channels are built in generics.
sync.Map is what the standard library version looks like. It loses type safety.
https://golang.org/pkg/sync/#Map https://golang.org/pkg/sync/#Map
- echlebek 6y agoI'm looking forward to seeing these types of libraries improve with generics. It's notably more work to use these data structures, even if they are used rarely.