logoalt Hacker News

andrewjf • yesterday at 9:37 PM • 3 replies • view on HN

Yeah but why wouldn't "x" be a type that could only represent positive integers?


Replies

grg0 • yesterday at 9:41 PM

I would like Ada-style integer types too, but I don't strictly know how those are implemented. Are you suggesting invariants should also be given at the type level?

Joker_vD • yesterday at 10:06 PM

Have you seen the wave of recent Whatever2Shell CVEs? Several of them happened precisely because "a type that could only represent positive integers" was used for the sizes.

➕ show 1 reply
kevin_thibedeau • yesterday at 9:40 PM

They really should just copy Ada rather than this whizbangery.

➕ show 1 reply