Hacker News new | ask | show | jobs
by dkarapetyan 4391 days ago
If you're doing mathematics then multiplication is the thing you care about and not its representation in any given number/notation system but if you're actually implementing multiplication then you definitely care about the actual bits and bytes. What structure you impose on top of the implementation to make it easier is all nice and well but don't fool yourself into thinking that types are the end of it. In fact to truly impose some kind of type structure so you could reason about what was going on at the hardware level you'd need more than just the integer type or the floating point type because those types don't let you reason about overflow/underflow at such a high level. Any correct implementation would need to worry about those restrictions and consequently would have to represent those restrictions in the type system.
1 comments

It's entirely possible to do so; there are even typed assembly languages and "bitdata" types and typed memory regions.

Types in general can be far more expressive than most people know. Very expressive types are not necessarily easy to work with, though.