by baldgeek · 11y ago · 0 comments
Prelude> let a = 1 :: Int
Prelude> let b = 2 :: Integer
Prelude> a+b
<interactive>:4:3:
Couldn't match expected type `Int' with actual type `Integer'
In the second argument of `(+)', namely `b'
In the expression: a + b
In an equation for `it': it = a + bArrrgh!! You mean "Lisp style". Lisp has had arbitrary-precision integers ("bignums") since 1971 -- long before Python was invented.
I think saying "unbounded int" is enough, but then people might say "what exactly do you mean by unbounded?" so I say it's about the same as a python int. Haskell itself predates python.
And IBM vacuum tube machines had arbitrary precision integers in the mid 50s, and transistor based ones in the 60s ;)
Okay, well, then, thank you for giving me the opportunity to educate people on a bit of history :-)
> IBM vacuum tube machines had arbitrary precision integers in the mid 50s, and transistor based ones in the 60s
I seriously doubt it. They may well have had variable precision, but I don't think they had unbounded precision. That is, there was always a limit such that a result over that limit would either wrap around or trap (I don't know which), but that limit could be different for different instructions. (I'll bet there was a hardware-enforced maximum limit too, on the order of 12 or 15 digits.)
It wasn't until 1969 that Knuth published algorithms for arbitrary-precision arithmetic. Also consider that arbitrary precision requires heap allocation, which certainly wasn't being done in hardware in the 1950s and -60s.
If you can substantiate your claim, I'll be suitably impressed, but I'm extremely skeptical.
I remember seeing PL/SQL circa Oracle 8i and it looking a lot like ADA.
Not a coincidence. The designers of PL/SQL were largely inspired by Ada's basic syntax and structure.
It's not an acronym, by the way, so no need to all-caps it.