Follow

@amiloradovsky@functional.cafe @gassahara@mstdn.io I don't know much about hardware, if the word halfing is more efficient than, say, a separate "now give me the higher word" instruction, or if some other hardware subsystem has to do it, then sure, I'll let the compiler handle it. I was just yelling at C, and every other language that inherited(or originated) that arithmetic interface. I want to write generic code that works on all arithmetic types, not all but the largest, and even works on weird user defined types if they implement a basic arithmetic interface, not requiring an illusive wider type, that at worst needs arithmetic of its own, and at best a weird bitshift interface. I think there is a whole world of arithmetic between modular and infinite, not even necessarily on conventional numbers.

If I go with the word halfing in generic code, in addition to making the compiler's job way harder, what do I do when the user defined type is a single indivisible digit? I cry, cause it's a backwards hack, not a proper interface for arithmetic.

So, at the end of the day, I have to handle so many edge cases that I never got around to doing it. The only language I know that has something close to what I want is swift, and I hate that so very much...

· · SubwayTooter · 1 · 0 · 0
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.