fennel1
A lisp programming language that runs on lua
Usage
fennel {[--repl] | [--compile
filename] | [--eval
source] | [filename]
[args ...]}
Overview
This manual page documents briefly the fennel command.
fennel is the main entry point for Fennel, a lisp programming language that runs on Lua runtimes. With no options or arguments, it runs an interactive Read-Eval-Print loop (REPL).
Given a filename as its first argument, it runs that file and passes it the subsequent arguments. Ahead-of-time compilation can be invoked with the --compile flag, while short snippets can be evaluated with the --eval argument.
Options
A summary of options is included below.
-
--repl -
Start an interactive repl session. This is the default when given no arguments.
-
--compile filename -
Perform ahead-of-time compilation on the provided file and write the Lua output to standard out.
-
--eval source -
Evaluate a given piece of source code and print the result.
-
--no-searcher -
When running a repl or a file,
fennel.searcheris installed by default so that therequirefunction can load Fennel files in addition to Lua files. This flag disables that behavior. Has no effect for ahead-of-time compilation.
-
--add-package-path path -
Add the given path to
package.pathso that therequirefunction will know to look there when searching for Lua modules.
-
--add-fennel-path path -
Same as above, but for Fennel's path used when searching for Fennel modules.
-
--globals VAR1[,VAR2...] -
Allow VAR1, VAR2, etc as globals in addition to the standard set of globals. This enables strict global checking even in ahead-of-time compilation where it otherwise would be disabled. Use "*" to disable globals checking.
-
--globals-only VAR1[,VAR2...] -
Same as above, but without the inclusion of the standard set of globals.
-
--require-as-include -
Instead of loading required modules at runtime, compile them inline into the main file being compiled. Only useful during ahead-of-time compilation.
-
--to-be-closed -
When compiling
with-openuse the to-be-closed feature of Lua 5.4+ to avoid interfering with traces.
-
--assert-as-repl -
Calls to the built-in function
assertfrom Fennel will be replaced with calls toassert-replso that when the assertion fails, a REPL will be started in which you can interactively debug.
-
--lambda-as-fn -
Replace
lambdafunction definitions withfn,removing the runtime overhead from arity checking.
-
--use-bit-lib -
Compile bitwise operations to use LuaJIT's bitop library instead of Lua 5.3+ bitwise operators.
-
--load FILE -
Load the specified file before any command is run.
- --compile-binary FILE OUT LUA_LIB LUA_DIR
-
Compile FILE to a standalone binary OUT using LUA_LIB and the Lua header files in LUA_DIR. See --compile-binary --help for details.
-
--no-compiler-sandbox -
Do not limit compiler environment (used in macros) to minimal sandbox.
-
--keywords KEYWORD1[,KEYWORD2...] -
Treat these symbols as reserved Lua keywords.
-
-h, --help -
Print a help message and exit
-
-v, --version -
Print the version number and exit
Use the NO_COLOR environment variable to disable escape codes in error messages.
Community
The mailing list is at https://lists.sr.ht/~technomancy/fennel while the issue tracker is at https://dev.fennel-lang.org. Most discussion happens on the #fennel channel of Libera chat.
History
- Arch Linux 2026-11-01: the text shown here
- Debian 13 (Trixie)
--lambda-as-fn since Arch Linux 2026-11-01;
--to-be-closed since Arch Linux 2026-11-01.