Freya, as any language running on the .NET's Common Language Runtime (CLR) supports the Common Type System (CTS). This is a uniform and consistent architechture, and there are no priviledged data types in it, so we cannot talk properly about predefined data types. The main integer type, for instance, is just the System.Int32 type from the CTS.
For the sake of simplicity, some of the CTS types are given short names that can be used regardless the context. This includes the possibility of avoiding a qualified name for these frequently used data types. This is achieved by defining synonyms at the global lexical level. You must realize, however, that these are not keywords, and that you can change the meaning of these predefined identifiers if you want.
Unfortunately, Pascal and Delphi historically had badly messed nomenclatures for the plethora of integer types their avatars supported. We have tried to simplify this mess as much as possible, while keeping some resemblance with the full qualified library equivalences and the corresponding C#'s keywords:
Freya | Library type | C# type | Meaning |
---|---|---|---|
SByte | System.SByte | sbyte | Signed, 8 bits |
Byte | System.Byte | byte | Unsigned, 8 bits |
Short | System.Int16 | short | Signed, 16 bits |
ShortInt | |||
UShort | System.UInt16 | ushort | Unsigned, 16 bits |
Word | |||
Integer | System.Int32 | int | Signed, 32 bits |
Cardinal | System.UInt32 | uint | Unsigned, 32 bits |
LongInt | System.Int64 | long | Signed, 64 bits |
LongWord | System.UInt64 | ulong | Unsigned, 64 bits |
Real types are simpler:
Freya | Library type | C# type | Meaning |
---|---|---|---|
Single | System.Single | float | Floating point, 32 bits |
Float | |||
Double | System.Double | double | Floating point, 64 bits |
Real |
These types are frequently used and they already had well established names in the Pascal tradition:
Freya | Library type | C# type | Meaning |
---|---|---|---|
Object | System.Object | object | The root of the type system. |
String | System.String | string | Immutable, Unicode character strings. |
Char | System.Char | char | Unicode characters, represented as unsigned 16 bits integers. |
Boolean | System.Bool | bool | Logical types. |
The Freya Programming Language
Project and file structure
Type declarations
Literal constants