Built-in Types

Cyrus Lang provides a set of built-in types to cover most common programming needs. Here's an overview of the fundamental types available in the language.

Numeric Types

  • Int: 64-bit signed integer
  • Float: 64-bit floating-point number
  • Bool: Boolean value (true or false)

Text Types

  • String: UTF-8 encoded string of characters
  • Char: Single Unicode character

Collection Types

  • Array<T>: Fixed-size array of elements of type T
  • List<T>: Dynamic-size list of elements of type T
  • Set<T>: Unordered collection of unique elements of type T
  • Map<K, V>: Key-value pairs with keys of type K and values of type V

Other Types

  • Option<T>: Represents an optional value of type T
  • Result<T, E>: Represents either a success value of type T or an error of type E

These built-in types form the foundation of Cyrus Lang's type system. In the following sections, we'll explore how to use these types effectively in your programs.