Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Very good article. Interesting approach working in harmony with `go vet`.by fithisux
- This feels like it should ideally be something public in the structs package so anyone can leverage it, not just a specially blessed internal thing for the sync package.
- You can very easily define one yourself.by wbl
- I agree, its a nice piece of semantics to be added to a structby ape4
- It's not a specially blessed type. As the article says, anything that implements sync.Locker acts like this.by advisedwang
- https://github.com/golang/go/issues/70811 Go moves slowlyby 0x696C6961
- I spoke with Aliaksandr Valialkin (author of noCopy) and he gave me his reasons:
- https://x.com/valyala/status/2088638160242683954
He also gave an answer of what he would change now: https://itnext.io/go-evolves-in-the-wrong-direction-7dfda8a1...
It seems he's not happy anymore with the new direction of Go because they're implementing things from other languages.
by meerita - He's right. Countering the performance advantage of Rust and keeping its simplicity would be higher priority.by fithisux
- > I'd remove user-defined generics from Go, and all the overcomplicated shit related to them, including iterator functions.
Go advances one blub ragequit at a time.
by zarzavat - > noCopy is a special marker for types that must not be copied after their first use.
if it looks like a hack, walks like a hack, and quacks like a hack...
- It's not really a hack. It's a hint to a static analyser, that's all.
- Every language can't be rust.by never_inline
- by saturn_vk
- The whole Go design philosophy in one sentence, that is what one gets by refusing to adopt modern language practices.by pjmlp
- I'd want to blame Go's compatibility guarantee for this, but I can't because it wouldn't actually stop them from adding a proper solution for this..
Just like the magic comments, it's a sad thing to see appear in this language because it feels like magic incantations one has to know that bend over backwards to not actually extend the language to fit the use case.
by breakingcups - Go's full of hacks, and holds no shame over it. Zero-initialized everything, and proceeding to 'defer' instead of RAII, generic builtin types despite lack of generics (until recently), no builtin list type, slices having capacity...
This was Go's design philosophy until Rob Pike left - to do the simple thing simply and not try to be clever about it.