Esc

prelude

moduleSource
  • macOS: Everything works on macOS
  • Linux: Everything works on Linux
  • Windows: Everything works on Windows
  • Wasm: Everything works on Wasm
ยทsince 0.36.1

Every program imports this module; there is nothing to write.

What every program has without importing anything: allocators, source locations, logging, type information and the compiler's intrinsics.

Procedures#

Platform#

Intrinsics#

memcpysince 0.36.1Source
(dest: *void, source: *void, count: s64)

Canonical bootstrap intrinsics declarations.

memsetsince 0.36.1Source
(dest: *void, value: u8, count: s64)
memcmpsince 0.36.1Source
(a: *void, b: *void, count: s64) -> s16

Types#

Canonical bootstrap platform declarations.

Operating_System_Tag :: enum u32 {
    NONE :: 0;
    KRAMPOS :: 1;
    WINDOWS :: 2;
    LINUX :: 3;
    ANDROID :: 4;
    IOS :: 5;
    MACOS :: 6;
    NN_SWITCH :: 7;
    PS4 :: 8;
    PS5 :: 9;
    XBOX :: 10;
    WASM :: 11;
    NN_SWITCH2 :: 12;
}
CPU_Tagenumsince 0.36.1Source
CPU_Tag :: enum u32 {
    UNINITIALIZED :: 0;
    KRAMPU :: 1;
    CUSTOM :: 2;
    X64 :: 3;
    ARM64 :: 4;
}
Allocator_Modeenumsince 0.36.1Source

Canonical bootstrap allocation declarations.

Allocator_Mode :: enum {
    ALLOCATE :: 0;
    RESIZE :: 1;
    FREE :: 2;
    STARTUP :: 3;
    SHUTDOWN :: 4;
    THREAD_START :: 5;
    THREAD_STOP :: 6;
    CREATE_HEAP :: 7;
    DESTROY_HEAP :: 8;
    IS_THIS_YOURS :: 9;
    CAPS :: 10;
}
Allocator_Capsenum flagssince 0.36.1Source
Allocator_Caps :: enum_flags u32 {
    MULTIPLE_THREADS :: 0x1;
    CREATE_HEAP :: 0x2;
    FREE :: 0x4;
    ACTUALLY_RESIZE :: 0x8;
    IS_THIS_YOURS :: 0x10;

    HINT_I_AM_A_FAST_BUMP_ALLOCATOR :: 0x0100_0000;
    HINT_I_AM_A_GENERAL_HEAP_ALLOCATOR :: 0x0200_0000;
    HINT_I_AM_PER_FRAME_TEMPORARY_STORAGE :: 0x0400_0000;
    HINT_I_AM_A_DEBUG_ALLOCATOR :: 0x0800_0000;
}
Newstringstructsince 0.36.1Source

Canonical bootstrap storage declarations.

Newstring :: struct {
    count: s64;
    data: *u8;
}
Array_View_64structsince 0.36.1Source
Array_View_64 :: struct {
    count: s64;
    data: *u8;
}
For_Flagsenum flagssince 0.36.1Source
For_Flags :: enum_flags u8 {
    POINTER :: 0x1;
    REVERSE :: 0x2;
}
Type_Info_Tagenumsince 0.36.1Source

Canonical bootstrap reflection declarations.

Type_Info_Tag :: enum u32 {
    INTEGER :: 0;
    FLOAT :: 1;
    BOOL :: 2;
    STRING :: 3;
    POINTER :: 4;
    PROCEDURE :: 5;
    VOID :: 6;
    STRUCT :: 7;
    ARRAY :: 8;
    OVERLOAD_SET :: 9;
    ANY :: 10;
    ENUM :: 11;
    POLYMORPHIC_VARIABLE :: 12;
    TYPE :: 13;
    CODE :: 14;
    UNTYPED_LITERAL :: 15;
    UNTYPED_ENUM :: 16;

    VARIANT :: 18;
}
Type_Info_Arraystructsince 0.36.1Source
Type_Info_Array :: struct {
    using #as info: Type_Info;

    element_type: *Type_Info;

    array_type: Array_Type;

    array_count: s64;

    Array_Type :: enum u16 {
        FIXED :: 0;
        VIEW :: 1;
        RESIZABLE :: 2;
    }
}
Type_Info_Procedurestructsince 0.36.1Source
Type_Info_Procedure :: struct {
    using #as info: Type_Info;

    argument_types: [] *Type_Info;
    return_types: [] *Type_Info;

    procedure_flags: Flags;

    Flags :: enum_flags u32 {
        IS_ELSEWHERE :: 0x1;
        IS_COMPILE_TIME_ONLY :: 0x2;
        IS_POLYMORPHIC :: 0x4;
        HAS_NO_CONTEXT :: 0x8;
        IS_C_CALL :: 0x20;
        IS_INTRINSIC :: 0x80;
        IS_SYMMETRIC :: 0x100;

        IS_CPP_METHOD :: 0x1000_0000;
        HAS_CPP_NON_POD_RETURN_TYPE :: 0x2000_0000;
    }
}
Enum_Status_Flagsenum flagssince 0.36.1Source
Enum_Status_Flags :: enum_flags u16 {
    INCOMPLETE :: 0x1;
}
Enum_Type_Flagsenum flagssince 0.36.1Source
Enum_Type_Flags :: enum_flags u16 {
    FLAGS :: 0x1;
    COMPLETE :: 0x2;
    SPECIFIED :: 0x4;
}
Struct_Status_Flagsenum flagssince 0.36.1Source
Struct_Status_Flags :: enum_flags u32 {
    INCOMPLETE :: 0x1;
    LOCAL :: 0x4;
}
Struct_Textual_Flagsenum flagssince 0.36.1Source
Struct_Textual_Flags :: enum_flags u32 {
    FOREIGN :: 0x1;
    UNION :: 0x2;
    NO_PADDING :: 0x4;
    TYPE_INFO_NONE :: 0x8;
    TYPE_INFO_NO_SIZE_COMPLAINT :: 0x10;
    TYPE_INFO_PROCEDURES_ARE_VOID_POINTERS :: 0x20;
    UNION_IS_TAGGED :: 0x40;
}
Struct_Nontextual_Flagsenum flagssince 0.36.1Source
Struct_Nontextual_Flags :: enum_flags u32 {
    NOT_INSTANTIABLE :: 0x4;
    ALL_MEMBERS_UNINITIALIZED :: 0x40;
    POLYMORPHIC :: 0x100;
}
Type_Info_Struct_Member :: struct {
    name: string;
    type: *Type_Info;
    offset_in_bytes: s64;

    flags: Flags;

    notes: [] string;

    offset_into_constant_storage: s64 = -1;

    Flags :: enum_flags u32 {
        CONSTANT :: 0x1;
        IMPORTED :: 0x2;
        USING :: 0x4;
        PROCEDURE_WITH_VOID_POINTER_TYPE_INFO :: 0x8;
        AS :: 0x10;
        OVERLAY :: 0x20;
    }
}
Type_Info_Structstructsince 0.36.1Source
Type_Info_Struct :: struct {
    using #as info: Type_Info;

    name: string;

    parameters: [] Type_Info_Struct_Member;

    specified_parameters: [] Type_Info_Struct_Member;
    members: [] Type_Info_Struct_Member;

    tagged_union_bindings: [] Type_Info_Tagged_Union_Binding;

    status_flags: Struct_Status_Flags;
    nontextual_flags: Struct_Nontextual_Flags;
    textual_flags: Struct_Textual_Flags;

    alignment: s32;

    polymorph_source_struct: *Type_Info_Struct;

    initializer: (*void) #no_context;

    constant_storage: [] u8;
    notes: [] string;
}
Source_Code_Locationstructsince 0.36.1Source

Canonical bootstrap diagnostics declarations.

Source_Code_Location :: struct {
    fully_pathed_filename: string;
    line_number: s64;
    character_number: s64;
}
Source_Code_Rangestructsince 0.36.1Source
Source_Code_Range :: struct {
    fully_pathed_filename: string;
    line_number_start: s64;
    line_number_end: s64;
    character_number_start: s64;
    character_number_end: s64;
}
Log_Levelenumsince 0.36.1Source
Log_Level :: enum u8 {
    NORMAL :: 0;
    VERBOSE :: 1;
    VERY_VERBOSE :: 2;
}
Log_Flagsenum flagssince 0.36.1Source
Log_Flags :: enum_flags u32 {
    NONE :: 0x0;
    ERROR :: 0x1;
    WARNING :: 0x2;
    CONTENT :: 0x4;
    TO_FILE_ONLY :: 0x8;
    VERBOSE_ONLY :: 0x10;
    VERY_VERBOSE_ONLY :: 0x20;
    TOPIC_ONLY :: 0x40;
}
Log_Sectionstructsince 0.36.1Source
Log_Section :: struct {
    name: string;
}
Name_Mappertypesince 0.36.1Source
:: #type ([] string)

Canonical bootstrap context declarations.

Constants#