Standard Library / Builtins, Math & Text

Builtins, Math & Text

Global builtins, mathematical constants, math, random, array, text, and regex.

Global Builtins & Constants

Available in every file without import: len(v), range(a, b), is_missing(v), to_int(v), to_float(v), to_string(v), to_bool(v), append(xs, x).

Global numeric constants: PI, E, TAU, INF, PHI, SQRT2, LN2, LN10.

math, random, & array

math_demo.dl
import math
import array

show math.mean([10, 20, 30, 40])
show math.std_dev([10, 20, 30, 40])

a = array.from([1.0, 2.0, 3.0])
b = array.from([4.0, 5.0, 6.0])
show array.dot(a, b)

text & regex

text_demo.dl
import text
import regex

parts = text.split("a,b,c", ",")
show text.join(parts, " | ")
show regex.is_match("^[0-9]+$", "2026")