News for hackers. Stuff that matters.
Re:Why Go and Not Rust? by mappu on Monday September 16, 2019 @04:49PM (#20988457)
I'm slightly surprised you found three different set implementations - `map[T]struct{}` is the idiomatic one i see everywhere.

I suppose it's not sorted or concurrent-safe?

Re:Why Go and Not Rust? by NoodleIncident on Monday September 16, 2019 @05:58PM (#20988984)
I mean that people make their own per-file or per-package set implementation for their service. There's no point putting it in a common utility package even within the same company, because it's specific to the type of what they're storing.

`map[T]struct{}` is only a type, it's not an implementation. You still need a handful of methods, that might be named inconsistently in each implementation by different developers. I will be happy when I never have to think about this again

Re:Why Go and Not Rust? by masklinn on Tuesday September 17, 2019 @07:37AM (#20993788)
> I'm slightly surprised you found three different set implementations - `map[T]struct{}` is the idiomatic one i see everywhere.

Set storage is not really the concern here, it's the set-theoretic operations which make sets useful (generally speaking, there are cases where all you need is the set being a set e.g. deduplication).

So I wouldn't be surprised that GP found several different implementations of union, intersection, difference, symmetric difference, subset, superset, …