Library reference
Built-in functions
Alphabetical index of every public built-in call and numeric conversion.
Built-ins are functions available without an import. Use the alphabetical index to look up a name, or choose a reference by topic. Record and enum constructors, operators and control-flow keywords are described in the language reference. range(...) is allocation-free for-loop syntax rather than a first-class callable or array constructor.
- Collections — arrays, Strings and tensor construction
- Conversions — numeric ranges and rounding
- Numerical operations — products, reductions and row math
- Tasks and devices — parallel mapping and transfers
Alphabetical index
- array — flatten a CPU tensor
- byteLength — count UTF-8 bytes
- concat — join arrays
- copy — create independent array storage
- devices.cpu — select the host device
- devices.gpu — select a GPU
- float — convert a scalar or tensor to float
- float32 — convert a scalar or tensor to float32
- float64 — convert a scalar or tensor to float64
- generate — construct an array by index
- int — convert a scalar or tensor to int
- int16 — convert a scalar or tensor to int16
- int32 — convert a scalar or tensor to int32
- int64 — convert a scalar or tensor to int64
- int8 — convert a scalar or tensor to int8
- length — count array elements or Unicode scalars
- map — transform an array sequentially
- matmul — multiply two matrices
- parallelMap — transform an array with CPU workers
- range (for syntax) — iterate over integers without an array
- reduceSum — sum tensor elements
- relu — apply rectified linear activation
- reshape — change a tensor shape
- rmsNormRows — apply unit-gain row normalization
- shape — read tensor extents
- slice — extract an array or String range
- softmaxRows — compute row probabilities
- sort — order an array in place
- sorted — create an independent sorted array
- tensor — construct a numeric tensor
- transfer — transfer a tensor between devices
- transpose — swap matrix axes
- uint — convert a scalar or tensor to uint
- uint16 — convert a scalar or tensor to uint16
- uint32 — convert a scalar or tensor to uint32
- uint64 — convert a scalar or tensor to uint64
- uint8 — convert a scalar or tensor to uint8
How to read the reference
Each entry gives the call signature, accepted inputs, result, execution location and possible failures. Multiple signatures under one name describe different accepted forms of the same call.
T and U stand for supported element types; F stands for a floating type. M, K and N stand for tensor dimensions. A signature using these letters explains a family of calls; it is not a generic declaration to paste into your program. For example, T in map may be int when mapping an [int] array.
Inputs described as completed values are ordinary values, not pending tasks; await a task before passing its result. A resident GPU tensor must be used on its device or transferred to the CPU before a host-only operation.
Type and statically known shape errors are reported before execution. Bounds, dynamic shape, arithmetic and allocation failures are checked while the program runs. An ordinary call does not automatically expose every fault as an application error. Tasks report execution failures through TaskError.
Built-in names are not first-class function values. To use one as a callback, wrap its call in a user-defined function.
Program output and external libraries
The command-line executable displays the value returned by main. There is no built-in print or general file/network I/O function in this interface. Packages can export their own functions; those names belong to the package rather than this built-in index.