Syntax

Bindings and calls

Assign with name = expression; no let or var is needed. Calls accept positional arguments and named arguments written as name=value.

input endpoint: url

# Fetch the endpoint and read a result field.
response = http.get(endpoint, timeout=5s)
status = response.status
out(status)

Use value.field for record fields and items[0] for the first list item. Reassign an existing variable with another = assignment.

Blocks and comments

Statements end at a newline or ;. Blocks require braces; indentation is for readability. # starts a comment through the end of the line.

attempts = 0
while attempts < 3 {
    attempts = attempts + 1
    print(attempts)
}

Use if / elif / else for branches. See Control flow for loop forms and limits.

Functions

Use fn for reusable logic and return for its result. Arrow functions are useful for short collection operations.

fn double(n: int) -> int {
    return n * 2
}

values = [1, 2, 3]
doubled = map(values, n => double(n))
out(doubled)

Prefer short bindings when a call or pipe grows long. Parentheses and square brackets allow multiline expressions; a bare newline in a pipe chain ends the statement.

Improve team velocity with
better security and privacy.