Built-in functions¶
Built-in functions are special keywords in Shards, prefixed with @, that provide core language features and utility operations. They are directly integrated into the compiler and runtime, making them faster and more predictable than user-defined functions or macros.
They are used for:
-
Data construction – e.g.,
@i2,@f3,@coloror@typefor creating vectors, floats, color values or type descriptions. -
Introspection and Environment – e.g.,
@namespace,@platform,@capture-eval, for querying state and capturing the evaluation context. -
Execution -
@wire,@mesh,@schedule,@runto execute shards code. -
Macros and Templating -
@define,@template,@macroand@astto group shards together for the purpose of reusing blocks of code.