Data Types

This section describes the data types available in the Horse64 programming language.

Overview

Data type nameHow to instantiateMutableGC load
nonenonenono
num1, 1.0, -2.332nono
str"bla", 'bla', ""nono
bytesb"test", b''nono
boolyes, nonono
vec[x:1, y:5, z:3, w:1.1]nono
list[], [1, 2]yesyes
map{"price"-> 5.0}, {->}yesyes
set{}, {1, 2}yesyes
typenew MyCustomType()yesyes
funcvar f = func test {}nono

Mutable types are passed by reference, immutable ones by value.

(Read more here about GC load.)

Custom data types with type

So-called custom types, or in short just types, are declared via the type keyword. Internally, they're basically just a struct like in C/C++ which contains a reference to the type definition they belong to, as well as all the values of the var attributes they have.

Since custom types can have var attributes pointing to other types and back in circles, they're allocated on the GC heap causing GC load.

Privacy | Admin Contact | Misc