4 ms·
Types that carry a semantic difference, not a difference on the level of technical implementation are a fascinatingly underutilized concept. I'm sure that the i
by usrusr 3y ago
Types that carry a semantic difference, not a difference on the level of technical implementation are a fascinatingly underutilized concept. I'm sure that the idea has been around forever, and implementations available as well, but it never really made the big splash that I think it should have.
I even carry a "what if" language concept in my mind (as in zero plans of implementation or anything like that, merely a thought experiment) where all names would be folded into types: in a lot of scopes you only ever have one of each. If you were to run Noah's ark you'd probably not bother remembering that you called the male penguin Frederick (or was it James?), you'd simply refer to him as the male penguin. The tools tools you'd want for dealing with all the situations where you need more than one in a scope would be just what the doctor ordered for that include semantic difference in typing thing.
- grncdr 3y agoYou may be interested to know that the Ceylon language has this (or had something very similar, I’ve not actually used it myself)