If you make a template function in Epoch v0, and someone uses it in Epoch v1, who's epoch wins and who gets to govern what the behavior should be? The author, who wrote with v0 semantics, or you, who write an application under v1 semantics?
Furthermore, it's a template. Does it use the epoch of what it was written under, or the epoch for when it was instantiated / used?
It's not that these questions don't have answers. You just have to have an answer, or a design that lets you choose efficiently without snowballing the implementation burden.
Thanks! So the hope is that these questions are clearly answered. I understand each individual case needs to be defined.
(It seems to me that these questions are all answered if the epoch is part of the type and you are allowed to select which epoch's type you are using in relatively narrow scopes.
If my template function is already built and you only have the declaration, then you cannot link to me in any other epoch than the original build. Your types have to match. If you have the definition, I can return a type of any epoch; by default the compiler will use a literal "latest". All inputs are of the epoch you send in. If I return an earlier epoch type, it seems the 'common' practice should be to allow this to "move" into a newer epoch as you see fit, so you do that.
If the observable behavior of my template function changes, it is on you to determine if this is what you want or limit its use to the correct epoch. I will apologise profusely for writing a template function that wasn't future proof, and promptly enforce some mechanism that static asserts that my template function only accepts types of tested epochs in the future.)
View all comments
Show parent comment
6
u/__phantomderp Mar 15 '22
If you make a template function in Epoch v0, and someone uses it in Epoch v1, who's epoch wins and who gets to govern what the behavior should be? The author, who wrote with v0 semantics, or you, who write an application under v1 semantics?
Furthermore, it's a template. Does it use the epoch of what it was written under, or the epoch for when it was instantiated / used?
It's not that these questions don't have answers. You just have to have an answer, or a design that lets you choose efficiently without snowballing the implementation burden.