Data Types
Ferret currently ships these core primitive types:
- integers:
i8,i16,i32,i64,isize,u8,u16,u32,u64,usize - floats:
f32,f64 - text/scalar:
str,char,bool,void
Numeric Types
Section titled “Numeric Types”let small: i32 = 10let large: i64 = 5000000000let ratio: f32 = 0.5let precise: f64 = 3.1415926535Text Types
Section titled “Text Types”let message: str = "hello"let letter: char = 'h'let first = (message as []u8)[0]str is immutable text. Convert to []u8 / []char for element-level access.
Composite Types
Section titled “Composite Types”let fixed: [3]i32 = [3]i32{1, 2, 3}let items: []i32 = []i32{1, 2, 3}let pair: (i32, bool) = (7, true)let maybe: ?i32 = noneOwnership Forms
Section titled “Ownership Forms”Tplain value*Towning pointer&T/&mut Tborrowed references^T/^const Traw pointers