3 ms·
Also a shining example of their poor type system.
by saintfiends 9y ago
Also a shining example of their poor type system.
- exacube 9y agohow so? how would a type system have helped here
- tptacek 9y agoSince everything in sync.Map appears to be laundered through interface{}, you lose compile-time type safety where you use it.
- masklinn 9y agoThe type system issues can also be seen in: * you get a note that a map must not be copied, but you won't actually be prevented from doing so? * iteration can't use the native construct (no generic interface -> no generic iteration)
- fmstephe 9y agoAnother concern (big or little depending on your circumstances) many common things stored in maps, strings, primitives, incur an allocation on conversion to interface{}. Coupled with a fairly inefficient GC it means I would need to think twice before using this.
- gtirloni 9y agoWhat's inefficient about Go's GC ?
- fmstephe 9y agoI think pcwalton expressed it clearly here https://news.ycombinator.com/item?id=14380575 https://news.ycombinator.com/item?id=14380575
- gtirloni 9y agoThanks. I also found this other discussion useful: https://news.ycombinator.com/item?id=12042302 https://news.ycombinator.com/item?id=12042302
- xyproto 9y agoUse it, then profile later?
- skybrian 9y agoWell, you might not want to put it in a public API anyway since it shouldn't be copied. Better if you wrap it somehow. Then it's similar to an unsafe section; you need to be careful but it's self-contained.
- deleted 9y ago[deleted]