Closed Qix- closed 7 years ago
Rejecting this as the type system has been revised a bit. The pieces are the same, but the ways they are semantically represented/used are now different.
For example, mutability is being broadened to mean Does not incur side effects - not just that it doesn't change the object's state. This means no I/O, etc. Routines being evaluated for side effects is now a language feature, as will be described in future RFCs.
Arua's primitive types consist of integers (unsigned/signed), floating point numbers, and arrays of those types. To be clear, arrays of types (including arrays of primitives) are their own individual types and are not directly coercible to their primitive counterparts.
Type Qualifiers
All declarations (
foo Type
) are considered immutable without the mutable type qualifier (foo !Type
). As well, all declarations are considered mandatory (cannot benil
) unless they have the optional type qualifier (foo Type?
). These qualifiers can be combined (foo !Type?
). Type qualifiers do not create or affect any type (they describe individual usages of existing types within a statement, rather than define the type itself).Implicit Conversions
Implicit Conversions are intuitive and simple in Arua. For a unit with a type
Child
that is a sub-type ofBase
(e.g. via atypedef
):* Only if it's the initial assignment
Optional Qualifiers
Optional qualifiers force a check of nil for all types before they can be referenced.
This check honors visibility (#19). Calls into functions check that operate on optional types must be in code paths that have already checked for
nil
. Unit-public functions always assume such checks have not been made.Signed-ness
All signed types (
i32
,i16
,i8
,iXX
) are Two's Complement representations.Floating Point
All floating point types (
f32
,f64
,fXX
) are IEEE 754 compliant floating point numbers.