Fennel

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.

Full Lua compatibility: Easily call any Lua function or library from Fennel and vice-versa.

Easily call any Lua function or library from Fennel and vice-versa. Zero overhead: Compiled code should be just as or more efficient than hand-written Lua.

Compiled code should be just as or more efficient than hand-written Lua. Compile-time macros: Ship compiled code with no runtime dependency on Fennel.

Ship compiled code with no runtime dependency on Fennel. 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.

( 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))))

Usage

See the install instructions in the setup guide.

That's too much work!

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

There's supposed to be an interactive repl here but it needs scripting to be enabled. You can install Fennel with git if you'd rather not enable scripting; it's cool. > Toggle Lua code

Documentation

The Setup guide is a good place to start.

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 special forms and what they're for.

The API listing explains how to embed Fennel into a Lua program.

The Changelog describes how Fennel has evolved with time.

Looking for other versions? Docs are generated for:

Development

Fennel's repository is on Sourcehut , and discussion occurs on the mailing list and the #fennel channel on Freenode and on Matrix .

There is also a wiki for collecting ideas.

Fennel is copyright © 2016-2020 Calvin Rose and contributors. released under the MIT/X11 license. This website is under the same terms and also stored on Sourcehut.