Joe Tsai

Results 341 comments of Joe Tsai

I'm realizing a major caveat with this is that this can hash pointers. In order for `Comparable(s, v1) == Comparable(s, v2) if v1 == v2` to hold, this probably implies...

In my application, I'm writing a generic data structure for packet processing, where I only care about hashing byte arrays. As a half-step measure, I wonder if there's value in...

For posterity, here are the thorny issues with pointers, interfaces, and channels: * This assumes that the GC is non-moving. * Even for today's GC, there's the movement due to...

Thanks @austin for that great write-up. Took me a bit time to digest it. In general, having all pointers and interfaces escapes sounds fine to me. To be honest, I...

That looks fine to me, but it would be unfortunate if we ever resolved #49085, in which case it would be more natural as: ```go func (h *Hash) WriteComparable[T comparable](x...

This is related to #33440. @smasher164 mentions the [existence of a total-ordering predicate](https://github.com/golang/go/issues/33440#issuecomment-517843916) that could be used to sort floats with NaNs.

What if instead, we provided a function in the `math` package like: ```go package math // FloatCompare compares x to y according to the // total-ordering predicate in IEEE-754, section...

My argument for it being in "math" is: 1) The other scalar kinds (int, uint) don't really have ambiguous definitions of ordering (i.e., the `

My reason for proposing a generic version was because you can't roundtrip convert a float32->float64->float32 and preserve the exact bits for NaNs. A single bit is mangled in the float32->float64...

> In addition, there isn't always an obvious sanitized name--we probably want to reject the name COM1 on Windows, but what would we rewrite it into? It isn't clear to...