NAME ^

docs/pdds/pdd04_datatypes.pod - Parrot's internal data types

ABSTRACT ^

This PDD describes Parrot's internal data types.

{{ NOTE: this is a good overview, but we need more complete specifications of the behavior of the datatypes. }}

DESCRIPTION ^

This PDD details the basic datatypes that the Parrot core knows how to deal with. Three of these (the integer, floating point and string datatypes) have no additional semantics. The fourth datatype, the Parrot Magic Cookie (PMC) acts as the basis for all high level languages running on top of Parrot; only the most basic aspects are described here.

Note that PMC and string internals are volatile and may be changed in the future (although this will become increasingly unlikely as we near v1.0). Access from external code to the internals of particular datatypes should be via the extension mechanism (see docs/pdds/pdd11_extending.pod, which has more explicit guarantees of stability.

IMPLEMENTATION ^

Integer data types ^

Integer data types are generically referred to as INTs. These are whatever size native integer was chosen at Parrot configuration time. The C-level typedefs INTVAL and UINTVAL get you a platform-native signed and unsigned integer respectively.

Floating point data types ^

Floating point data types are generically referred to as NUMs. These are whatever size float was chosen when parrot was configured. The C level typedef FLOATVAL will get you one of these.

ATTACHMENTS ^

None.

REFERENCES ^

The perl modules Math::BigInt and Math::BigFloat. Alex Gough's suggestions for bigint/bignum implementation, outlined in docs/pdds/pdd14_bignum.pod. The Unicode standard at http://www.unicode.org.

GLOSSARY ^

Type

Type refers to a basic Parrot data type. There are four such: integers, floating point numbers (often just numbers), strings and Parrot Magic Cookies (PMCs).

VERSION ^

1.4

CURRENT ^

     Maintainer: Dan Sugalski <dan@sidhe.org>
     Class: Internals
     PDD Number: 4
     Version: 1.5
     Status: Developing
     Last Modified: 11 June 2005
     PDD Format: 1
     Language: English

HISTORY ^

Version 1.5, 11 June 2005

Version 1.4, 20 February 2004

Version 1.3, 2 July 2001

Version 1.2, 2 July 2001

Version 1.1, 2 March 2001

Version 1, 1 March 2001

CHANGES ^

Version 1.5

Removed BigInt and BigNum from the definition of I* and N* registers -- according to Leo they are now always PMCs, never register types of their own.

Version 1.4

Document basic PMC internals. Make clear the fact that the bigint/bignum description is still provisional. Other minor fixups to make the documentation match reality.

Version 1.3

Fixed some silly typos and dropped phrases.

Took all the underscores out of the field names.

Version 1.2

The string header format has changed some to allow for type tagging. The flags information for strings has changed as well.

Version 1.1

INT and NUM are now concepts rather than data structures, as making them data structures was a Bad Idea.

Version 1

None. First version


parrot