--- layout: page published: true noToc: false noComments: false noDate: false title: Fun - Fun executable: full usage guide subtitle: Full usage guide for the `fun` executable, invocation patterns, REPL, env vars, include paths, examples, and install locations. description: Full usage guide for the `fun` executable, invocation patterns, REPL, env vars, include paths, examples, and install locations. permalink: /documentation/fun/ lang: en tags: - env - examples - executable - full - include - install - invocation - locations - paths - patterns - vars --- This document explains how to use the `fun` binary after building or installing it: invocation patterns, options, environment variables, include/search paths, REPL, and examples. ## Synopsis
fun [options] [- If `] [-- args...]
fun /usr/share/fun/examples/hello.funRunning from a build tree (not installed):
FUN_LIB_DIR=./lib /path/to/build_dir/fun examples/hello.funPassing arguments to scripts (arguments after `--` are forwarded to the script environment):
fun myscript.fun -- arg1 arg2## Build and install locations - Build targets: `fun` is produced by the `fun` target. In CLion/CMake, typical build directories are `build_debug` or `build_release`. - Install locations (by default): - Binary: `/usr/bin/fun` - Stdlib: `/usr/share/fun/lib` - Examples (optional): `/usr/share/fun/examples` To stage an install without touching the system:
DESTDIR=./tmp/stage cmake --build## See also - `documentation/cli.md` — concise CLI reference (synopsis/options/exit codes) - `documentation/funstx.md` — syntax checker for `.fun` files with optional `--fix` - `documentation/examples.md` — how to run the bundled examples - `documentation/includes.md` — include paths, namespacing, and `FUN_LIB_DIR`--target install ./tmp/stage/usr/bin/fun ./examples/hello.fun