fennel-lang.org

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

  • Full Lua compatibility: Easily call any Lua function or library from Fennel and vice-versa.
  • Zero overhead: Compiled code should be just as efficient as hand-written Lua.
  • Compile-time macros: Ship compiled code with no runtime dependency on Fennel. Standalone binaries can be as small as 300kb.
  • Embeddable: Fennel is a one-file library as well as an executable. Embed it in other programs to support runtime extensibility and interactive development.

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

Install it now!

;; 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 [dx dy] (pairs dirs)]
  (when (love.keyboard.isDown key)
    (let [[px py] player
          x (+ px (* dx player.speed dt))
          y (+ py (* dy player.speed dt))]
      (world:move player x y))))

I don't feel like installing it right now!

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

  • The Setup Guide will help you install things.
  • The Tutorial teaches you the basics of the language.
  • The Rationale explains the reasoning why Fennel was created.
  • The Lua Primer will catch you up if you don't already know Lua.
  • The Reference lists out all built-in forms and what they're for.
  • The Fennel from Clojure guide helps if you have a background in Clojure.
  • The Style Guide advises on how to write clear and concise code.
  • The Macro Guide explains metaprogramming with macros.
  • The API Listing explains how to embed Fennel into a Lua program.
  • The Changelog describes how Fennel has evolved with time.
  • The Wiki has all kinds of things in it.

Looking for other versions? Docs are generated for:

Development

We track bug reports, enhancement ideas, and other issues on dev.fennel-lang.org .

Fennel's repository is on Sourcehut.

See the security page for details about reporting security issues.

Community

All community interactions are subject to the code of conduct.


Read the original on fennel-lang.org ↗