futhark script [options…] program expression


The command futhark script foo.fut expr will compile foo.fut, run the provided FutharkScript expression expr, and finally print the result to stdout. It is essentially a simpler way to access the evaluation facilities of futhark-literate, and provides the same FutharkScript facilities.

If the provided program does not have a .fut extension, it is assumed to be a previously compiled server-mode program, and simply run directly.



The backend used when compiling Futhark programs (without leading futhark, e.g. just opencl). Defaults to c.

-D, --debug

Pass -D to the executable and show debug prints.


The program used to perform operations (eg. compilation). Defaults to the binary running futhark script itself.

-L, --log

Pass -L to the executable and show debug prints.


Pass an option to benchmark programs that are being run.


Pass an extra option to the compiler when compiling the programs.


Do not run the compiler, and instead assume that the program has already been compiled. Use with caution.

-v, --verbose

Print verbose information on stderr about directives as they are executing. This is also needed to see #[trace] output.


FutharkScript expressions can only refer to names defined in the file passed to futhark script, not any names in imported files.

If the result of the expression does not have an external representation (e.g. is an array of tuples), the value that is printed is misleading and somewhat nonsensical.


futhark-test, futhark-bench, futhark-literate