News for hackers. Stuff that matters.
Re:Hacking sum types with Go generics by skybrian on Monday March 14, 2022 @12:13PM (#30674219)
How does this affect performance? Maybe sticking with switch statements and writing a linter of some sort to do exhaustiveness checks would be a better idea?
Re:Hacking sum types with Go generics by wlamartin on Monday March 14, 2022 @12:29PM (#30674441)
Re:Hacking sum types with Go generics by lawrjone on Monday March 14, 2022 @12:25PM (#30674400)
I should say, we have absolutely no performance requirements, at least in terms of what this will do.

If we could add 10% developer efficiency for 20% performance hit, we'd take that in a heartbeat. The nanoseconds this construct might cost are just irrelevant to us, our customers, or our bottomline.

Obviously if you're writing some low-level performance sensitive code then this won't be free, but I expect most people are in our situation.