Follow

@amiloradovsky@functional.cafe @gassahara@mstdn.io But I don't want hardware dependent pieces in my code ToT I want them in the compiler. The language must be expressive to make the job of the compiler writers easier, and also fit similar use cases for types that have nothing to do with the hardware. If you want it to work with native ALU word or smallest SIMD/GPU size that can fit the input for best performance, or a special type representing one ternary bit to be compiled into a circuit diagram, or something that's not even a number in conventional sense, you customize that through the type system, while the algorithm and the interface remain generic, cause it's arithmetic, I didn't make it up, ancient mathematicians did, and it survived to this day. As it stands the C style arithmetic types are edge cases that I have to work around, while their essence can be easily captured by the interface that returns two digits/numbers. A type that only needs lower part and just doesn't care if it overflows, can always set the higher part to zero (or special zero type if you have a type system) and the compiler can see that and optimize. An infinite precision, or more precisely an "assumed to not overflow" (I'm looking at you, int!), type can do the same.

· · 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.