Description #
Fennel is a lightweight Lisp dialect that compiles to Lua, offering Lisp’s powerful macros and metaprogramming features with seamless Lua interoperability.
History #
Fennel was created in 2016 by Phil Hagelberg (also known for Leiningen in the Clojure community). It was designed to bring a minimal and expressive Lisp to environments where Lua is common—especially game development and embedded systems.
Hello World Code #
fennelCopyEdit(print "Hello, World!")
How to Run #
Option 1: Online
https://fennel-lang.org/see
Option 2: Local
Requires Lua installed. Then:
curl -O https://fennel-lang.org/downloads/fennel
chmod +x fennel
./fennel hello.fnl
Or run in REPL:
./fennel
> (print "Hello, World!")
Key Concepts #
- Lisp-style syntax (prefix notation, parentheses)
- Compiles directly to Lua
- Dynamically typed
- Macro system for metaprogramming
- Zero dependencies, tiny footprint
- Interoperates fully with Lua libraries and runtime
- Great for scripting in game engines (e.g., Love2D)
- Single binary distribution
- Tail-call optimization
- REPL and script modes supported
Try It Online #
Fun Facts #
- Fennel was originally called “fnl” (short for “functional Lua”).
- Used in projects like TIC-80 and Neovim plugins.
- Its macro system makes it a powerful alternative to Lua for metaprogramming.