Skip to content

Language guide ​

The language guide covers all of Lask, one topic per page. Each topic is a small, complete project: a main.lask whose comments explain the code next to them, and a few commands to run while you read.

If you haven't yet, start with Getting started, Your first real task file and Core concepts. This guide assumes you know what a task, an environment and lask sync are.

How to try a topic ​

Every topic lives in the lask repository, under example/02-language/. Clone it once:

bash
git clone https://github.com/lask-task-runner/lask.git
cd lask/example/02-language/02-functions
lask check
lask eval greet alice --prefix hi

Most topics are a single file. For those, you can also paste the source shown on the page into a main.lask in an empty directory. The topic page says when it has more than one file.

Topics marked "Lask only" in the table run no commands, so they need no Docker. For the others, run lask sync in the topic's directory before the first run or eval, to pull the images it uses.

In the commands on each page, eval prints a task's return value, so you can see what it computed. run prints only the command log, on stderr.

Topics ​

The table is in reading order. The first three topics are the language itself; Environments and Commands are what make it a task runner; the rest build on those.

TopicCoversNeeds
Values and typesBindings, annotations, type aliases, records, maps, unions, optional fields, generics, castLask only
FunctionsPositional, variadic and keyword parameters, lambdas, higher-order functions, |> and >>Lask only
Control flowdo, if with and without else, c ? a : b, all three forms of case, forLask only
Execution environments#local, tags, digests, run options and runnable, a Dockerfile recipe, environments as valuesDocker
Commands$, $1, $2, $*, interpolation and its escaping, raw holes #!{...}, dispatch, runDocker
Concurrencyasync / await, spawn, all, raceDocker
Errorstry / catch / finally, fail, error, recover, exit codesDocker
Modules and importsNamed and namespace imports, internal, re-export, per-module command declarationsDocker for the last task only
External dependencieslask.json, the committed lock file, importing a shared module by name, lask depsDocker, and one network step
The built-in libraryNumbers, strings, regular expressions, arrays, mapsLask only
Structured dataJSON, YAML, TOML, CSV, dotenv, cast, hashes, base64Lask only
Input, output and secretsstdin, the stdout contract, get_env and friends, !!, logDocker for the two secret tasks only
Files and pathsread_file / write_file / glob and the environment each one namesDocker for two tasks; the rest run on #local
Documentation and the command lineDoc comments, @param, @complete, @hidden, and how a signature becomes a command lineLask only

The Quick reference covers the same ground on one page, and the specification has the exact rules.

Released under the MIT License.