On Sep 25, Mathieu Bouchard wrote:
> On Mon, 24 Sep 2001, Kurt D. Starsinic wrote:
> > On Sep 23, Simon Cozens wrote:
> > > Once a language acknowledges that it is dealing with pure,
> > > honest-to-God integers, then it is fairly easy to compile down to
> > > integer-specific opcodes.
> > Of course, no (implementable) programming language *ever* deals with
> > actual integers. They always deal with limited domains.
>
> If I type 3**100000 I get an answer. That number is 19816 bytes long.
OK, ruby has bignums.
> The domain is limited only because the informational content of very large
> integers is, well, very large, in the way it is represented. Not only the
> machine has a maximum number of bytes it can handle, but also it has a
> limited amount of time before the user gets tired of waiting for the
> result, the latter of which puts a limit on practicality well before the
> limit on possibility is put. Whatever. Given a computer with unbounded
> memory and unbounded time, for every finite number N you may find a finite
> pointer size (roughly, log(log(N))) which will make ordinary
> unbounded-integer algorithms work on that size of numbers.
Give me a computer with unbounded memory, and I'll take it all back.
> Ruby's Integers are unbounded (given this explanation of what unbounded
> means in the context of computation)
Nope, they're bounded by available memory and time. The important point
is that every virtual machine has to have one or more models for mapping
a finite set of numeric values to machine representations. Saying "it's
an integer" can _never_ be entirely accurate. Sometimes it's a good first
approximation for a given problem domain.
- Kurt