Fennel is a programming language that brings together the speed, simplicity, and reach of Lua with the flexibility of a lisp syntax and macro system.

Anywhere you can run Lua code, you can run Fennel code.

;; Sample: read the state of the keyboard and move the player accordingly
(local dirs {:up [0 -1] :down [0 1] :left [-1 0] :right [1 0]})

(each [key delta (pairs dirs)]
  (when (love.keyboard.isDown key)
    (let [[dx dy] delta
          [px py] player
          x (+ px (* dx player.speed dt))
          y (+ py (* dy player.speed dt))]
      (world:move player x y))))

See the install instructions in the setup guide.

That's too much work!

Fine, you can use Fennel right here without installing anything:

Curious about how a piece of code compiles? See for yourself with a side-by-side view how Fennel turns into Lua and vice-versa.

Documentation

Looking for other versions? Docs are generated for:

Community

Fennel's repository is on Sourcehut, and discussion occurs on the mailing list and in the #fennel channel on Libera.Chat and on Matrix. Bug reports are tracked in Sourcehut or in Github. There is also a wiki for collecting ideas.

Take a look at the list of codebases written in Fennel if you want to get a feel for how larger projects look. The cookbook has smaller self-contained examples.

Community interactions are subject to the code of conduct.

The 2021 Fennel Survey recently had its results published.


Fennel is copyright © 2016-2021 Calvin Rose and contributors and is released under the MIT/X11 license. This website (source) is under the same terms.

Home

Toggle lines