Skip to content

DSL Reference: Overview

LINAL Script is a SQL-inspired language for tensor algebra and relational analytics. This reference covers every keyword, operator, and built-in function, organized by task rather than dumped alphabetically:

Page Covers
Data & Resources Types, defining tensors and datasets, schema evolution, zero-copy aliases
Querying SELECT, JOIN, CTEs, window functions, INSERT/UPDATE/DELETE, vector functions in SQL
Vectors & Linear Algebra Tensor math keywords, signal processing, classical linear algebra decompositions
Pipelines & Vector Search Named reusable pipelines, CREATE INDEX, SEARCH, TRANSFORM
Persistence & Server Save/load/import/export, database/session management, diagnostics, the HTTP server

If you haven’t run anything yet, the Quickstart is a faster way in: it walks one real session end to end. Come back here once you know what you’re looking for.

  • Comments start with --, #, or // and run to the end of the line; blank lines are ignored.
  • Over the CLI/REPL and .lnl files, one statement per line: the file runner tracks bracket balance, but keeping one statement per line avoids ambiguity.
  • Over the HTTP /execute endpoint, each request is exactly one statement: no trailing semicolon, no multi-statement bodies. See Persistence & Server.
  • Strings are double-quoted ("like this").
  • Vector and matrix literals mirror Python list/nested-list notation: [1.0, 2.0, 3.0], [[1, 0], [0, 1]].

Every fallible operator in linaldb (a singular matrix passed to INVERSE, a shape mismatch in MATMUL) errors loudly rather than returning a silent NaN or wrong result. See Error Reference if you hit one you don’t understand.