Re: Memory

new topic     » goto parent     » topic index » view thread      » older message » newer message

Carl R White writes:

> I seem to remember you saying a while back that Euphoria
> uses 31-bit integers. The missing bit being used to indicate
> whether the data at a location is an address or an integer.
> Surely this means Euphoria can only address 2^31 (~2Gig).

Euphoria *can* use the full 4Gig. (I don't want to go into all the
implementation details.)

> Cheeky Request: Any chance of adding 64-bit integers and double length
>                floats in the near future? Or auto-promotion if things get
>                too big?

An implementor of Euphoria has a lot of freedom.
He can store atoms and sequences in any memory layout
that he wants - the Euphoria programmer can't tell whether an
atom is stored in one bit, one byte, 4 bytes, a double, a 64-bit integer
etc. Since there are no pointers in Euphoria,
people can't go picking through the memory layout of a
data object. This lets implementers of Euphoria
change the layout without breaking any existing code.

Euphoria currently uses 64-bit double-precision floating-point
internally. If 128-bit were available, at the same speed, then
Euphoria might start to use it. Euphoria could also use
64-bit machine integers to store integer values.

The "integer" type in Euphoria has been defined as 31-bits,
and some rare code might break if that were changed.
We could instead add a new type for 64-bit integers. But
keep in mind that, unlike other languages, Euphoria does not *have* to
define a new type, in order to utilize a new machine storage format.
In fact, Euphoria doesn't really care what type you declare for a variable
-- Euphoria will store and manipulate data *values* in whatever
form is convenient. In Euphoria types are optional - they
are there to catch errors and provide some documentation. They
do not dictate the format of data in memory.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu