I think that part of the problem is that you try to apply this to low level variables.
If you consider a framework on top of any existing language that provides serialization mechanics that include metadata about the item, then you can approach your 2 goals.
I think that one important aspect (whether that is feasible or not is another question) is to have valid coercion. JS has some, but as your example shows, it is not complete.
Is the binary equal value a requirement or is it the semantic value which can take another form but can be interpreted in the same way?
Very interesting topic overall and I've been touching these questions a bit (until I had nightmares).
simon84•40m ago
If you consider a framework on top of any existing language that provides serialization mechanics that include metadata about the item, then you can approach your 2 goals.
I think that one important aspect (whether that is feasible or not is another question) is to have valid coercion. JS has some, but as your example shows, it is not complete.
Is the binary equal value a requirement or is it the semantic value which can take another form but can be interpreted in the same way?
Very interesting topic overall and I've been touching these questions a bit (until I had nightmares).