this evening i had a stunning realisation that i had eliminated reflection and empty interfaces, but then i had already coded in the idea that every variable has a codec, that converts its data into a stream of bytes.
and then as we are getting to the last pieces chasing those pesky empty interfaces. wait. everything *has* a codec every codec makes bytes of a particular length. some types only have minimal length. the codec interface should really have these concepts in them. minlen, maxlen. this should be standard method too. and i realised, reflection can be boiled down to encoding to a common type "[]byte" something i've been saying for years.
ok, so we still have reflection after a fashion, but not the same in that we need type machinery for it.
and then as we are getting to the last pieces chasing those pesky empty interfaces. wait. everything *has* a codec every codec makes bytes of a particular length. some types only have minimal length. the codec interface should really have these concepts in them. minlen, maxlen. this should be standard method too. and i realised, reflection can be boiled down to encoding to a common type "[]byte" something i've been saying for years.
ok, so we still have reflection after a fashion, but not the same in that we need type machinery for it.
1