FUTHARK-SCRIPT(1)
β¨ FUTHARK-SCRIPT(1) β¨
okay bestie, welcome to the Futhark manual, page futhark-script π
this is the one where we just... run an expression? iconic behavior honestly.
πΈ NAME πΈ
futhark-script β execute a FutharkScript expression π
π¦ SYNOPSIS π¦
futhark script [options...] program [expression]
π DESCRIPTION π
so the command futhark script foo.fut expr will compile foo.fut, run the FutharkScript expression expr that you handed it, and then print the result to stdout. that's it, that's the whole vibe β¨
it's basically the low-effort, main-character way to get at the evaluation facilities of futhark-literate, and it gives you the exact same FutharkScript facilities β plus a few extra built-in procedures, which are documented below π«Ά
if the program you gave it doesn't have a .fut extension, then futhark script assumes it's a previously compiled server-mode program and just runs it directly. no compilation arc, we skip straight to the content π
and like, when -e and -f are used, the expressions run in the order you provided them, but only the value of the last expression gets printed. so multiple uses of these options are only actually useful when they invoke procedures that have side effects. yup. noted. periodt.
π OPTIONS π
--backend=nameβ the backend used when compiling Futhark programs, with no leadingfuthark, so like, justopencl. defaults toc.-b,--binaryβ produce output in the binary data format. it fails if the value isn't a primitive or an array of primitives, so don't try it with anything fancy π-D,--debugβ passes-Dto the executable and shows debug prints.-e,--expression=EXPβ evaluate this FutharkScript expression. expressions run in the order provided.--futhark=programβ the program used to perform operations (like, compilation, for example). defaults to the binary that's runningfuthark scriptitself. so... itself. recursive queen.-f,--file=FILeβ read and evaluate a FutharkScript expression from this file. expressions run in the order provided.-L,--logβ passes-Lto the executable and shows debug prints.--pass-option=optβ pass an option to benchmark programs that are being run.--pass-compiler-option=optβ pass an extra option to the compiler when compiling the programs.--skip-compilationβ do not run the compiler, and instead assume the program has already been compiled. use with caution π seriously, be careful.-v,--verboseβ print verbose information onstderrabout directives as they're executing. this is also needed to see#[trace]output, so if your trace prints are ghosting you, this is why π
π§ ADDITIONAL BUILTINS π§
$store "file" vβ store the valuev(which must be a primitive or an array) as a binary value in the given file.
π BUGS π
FutharkScript expressions can only refer to names defined in the file passed to futhark script β not any names in imported files. sorry babe, the imports don't get a say π
and if the result of the expression doesn't have an external representation (like, say, it's an array of tuples), then the value that gets printed is misleading and somewhat nonsensical. so like... read it at your own risk, bestie.
π SEE ALSO π
futhark-test, futhark-bench, futhark-literate
Copyright β 2013-2020, DIKU, University of Copenhagen π
k that's the whole page, mwah π this was version 0.25.32, dated Mar 11, 2026 β go compile something gorgeous, bestie βπ
π¦ where this page comes from
- ubuntu resolute: futhark 0.25.32-3build1 Β· ISC
- ubuntu stonking: futhark 0.25.32-3build1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms