4 ms·
(Hoping you see this. HN's lack of reply-alert is not super practical) > What is the target type for x+x? There's no 'target' except the assigned 'y'. The com
by alcover 3y ago
(Hoping you see this. HN's lack of reply-alert is not super practical)
> What is the target type for x+x?
There's no 'target' except the assigned 'y'. The compiler would just do
y = CLIP((x+x)+y)
with x and y cast to int64 in the expression or smth like this.
> i noticed the sheer amount of design choices that were needed
I was just imagining these types. You are most certainly right that it would be pretty involved to get right.
- nuancebydefault 3y agoOkay that type of 'target' i have never seen in pactice, it would mean that if you would write the same equation using 2 statements, the casting would be different because you then would have 2 targets. Anyway, there are endless ways of designing a language, all with pros and cons. Nice exercise of thought.