YREA-SLS/docs/primitive_types.md

1011 B

Title Prev Next
YREA SLS | 3 Primitive Types Lexical Structure Basic Operation

3. Primitive Types

The language provides several built-in primitive types for common values:

Integer Types

  • i8, i16, i32, i64 - Signed integers (8, 16, 32, 64 bits)
  • u8, u16, u32, u64 - Unsigned integers (8, 16, 32, 64 bits)
  • Default integer literal type: i64

Floating Point Types

  • f32 - Single-precision floating point (32 bits)
  • f64 - Double-precision floating point (64 bits)
  • Default floating point literal type: f64

Other Types

  • bool - Boolean values (true or false)
  • char - Single UTF-8 character

Type Annotations

You can explicitly annotate literal types:

42:i32      // 32-bit integer
3.14:f32    // 32-bit float

Pointer Types

Raw pointers (ptr) are a future feature. See Appendix F for the planned pointer type system.

Related: See Section 8 for the complete type system, including composite types and type inference.