News for hackers. Stuff that matters.
Re:Spectral Contexts in Go by morelisp on Sunday June 18, 2023 @04:53PM (#36384344)
Don't do it. Don't past non-request-scoped data through contexts, and none of these are request-scoped. You can trivially pass such values through middlewares using methods or closures.

Also, while I think I know what "unlike Rust, these phantom types appear at runtime in Go" is saying, it's saying it in a really confusing way. These types do not "appear at runtime"; they are exactly like all other types, constructed at compile time and visible when interface-boxed at runtime. They're in no way "spectral".

Re:Spectral Contexts in Go by dazamarquez on Sunday June 18, 2023 @10:42PM (#36386759)
"phantom" and "phantom type" are well-understood terms that describe a type with a type parameter that isn't used in the type definition. "spectral" is a pun (phantom -> spectral). It has nothing to do with runtime representation of types.