Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Intrinsics

Intrinsics are compiler-builtin operations prefixed with @. They bypass normal name resolution and map directly to low-level operations.

Syntax

@name(args)

Examples:

@add(x, y)
@nop()
@fma(a, b, c)

Purpose

Intrinsics exist for operations that cannot be expressed in Ore itself:

  • Arithmetic primitives@add<T>, @sub<T>, @mul<T>, etc. (used to implement operator traits)
  • Memory operations@alloc, @free, @load<T>, @store<T>, @copy
  • System calls@write, @read, @open, @close, @exit
  • Type operations@sizeof<T>, @as<To> (casting)
  • Process control@panic, @exit, @arg_count, @arg

Regular Ore code rarely uses intrinsics directly. They are primarily used in the standard library to implement traits and effects.