News for hackers. Stuff that matters.
Re:Good-bye core types; Hello Go as we know and love it by fuzztester on Wednesday March 26, 2025 @09:20PM (#43489469)
>I can’t say I love the way Go implemented it though.

Why not?

Re:Good-bye core types; Hello Go as we know and love it by hnlmorg on Thursday March 27, 2025 @03:43AM (#43491247)
It might just be user error on my part but it wasn’t entirely clear to me:

1. How it should be implemented “correctly”

2. The resulting code isn’t clear how it works at first glance (particularly with the yield command, it has “magical” properties that take a little effort to grok)

3. Requires calling a method

Example code: https://github.com/lmorg/Ttyphoon/blob/321738f289e4791e9674d...

I did write this at something like 11pm so it’s entirely possible I’ve done this completely wrong though.

Also please ignore the weird use of mutexes here too.

I’m also aware that sync.Map could/should have been used here. This struct was more of an experiment than anything that will ultimately find its way into production code.

Re:Good-bye core types; Hello Go as we know and love it by dharmab on Thursday March 27, 2025 @04:00AM (#43491320)
In this specific case, one could do something like https://github.com/dharmab/skyeye/blob/main/pkg/radar/contac.... But your critique is still relevant for cases where you are generating/querying items on demand.
Re:Good-bye core types; Hello Go as we know and love it by hnlmorg on Thursday March 27, 2025 @11:21AM (#43494584)
Thanks for sharing that. I’ll give that a play tonight.