Skip to content

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, @color or @type for 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, @run to execute shards code.

  • Macros and Templating - @define, @template, @macro and @ast to group shards together for the purpose of reusing blocks of code.