# Fennel

> Scripting language

**Wikidata**: [Q102205251](https://www.wikidata.org/wiki/Q102205251)  
**Source**: https://4ort.xyz/entity/fennel

## Summary
Fennel is a scripting language and a dialect of Lisp designed to be compatible with the Lua programming language. It functions as a source-to-source compiler, allowing developers to write code using Lisp syntax and functional paradigms that runs on the Lua runtime. The language is maintained online at fennel-lang.org and is widely available through various software package repositories.

## Key Facts
*   **Classification:** Fennel is an instance of a scripting language and a source-to-source compiler.
*   **Lineage:** It is a subclass of Lisp, a functional programming language based on lambda calculus.
*   **Compatibility:** The language is designed to be compatible with Lua.
*   **Website:** The official website is located at `https://fennel-lang.org/` (English).
*   **Documentation:** The official wiki is available at `https://wiki.fennel-lang.org/` (English).
*   **Source Code:** The repository is hosted at `https://sr.ht/~technomancy/fennel/sources` and is accessible via HTTPS and Secure Shell (SSH).
*   **File Formats:** It utilizes the "Fennel source code file" format for both reading and writing code.
*   **Package Availability:** The software is available in Arch Linux (`fennel`), MacPorts (`lua-fennel`), and SlackBuilds (`development/Fennel`).

## FAQs
### Q: What type of programming language is Fennel?
A: Fennel is a scripting language and a source-to-source compiler. It is a dialect of Lisp, meaning it supports functional programming based on lambda calculus.

### Q: What environment does Fennel run on?
A: Fennel is compatible with Lua. It is designed to handle run-time events within the Lua ecosystem.

### Q: Where can Fennel source code and documentation be found?
A: The official source code is hosted on Sourcehut (`sr.ht`), while the official website and wiki are hosted at `fennel-lang.org` and `wiki.fennel-lang.org` respectively.

## Why It Matters
Fennel serves as a bridge between the Lua runtime environment and the Lisp family of programming languages. By functioning as a source-to-source compiler, it allows programmers to leverage the syntax and macro capabilities of Lisp while maintaining full compatibility with the existing Lua ecosystem, which is widely used in embedded systems, game development, and scripting.

This compatibility lowers the barrier to entry for using Lisp-like functional paradigms in environments where Lua is the standard scripting engine. The language is actively maintained and distributed through standard channels, making it a practical tool for developers looking for alternative syntaxes to write Lua code.

## Notable For
*   **Lisp on Lua:** Being a subclass of Lisp that is specifically compatible with the Lua programming language.
*   **Compiler Architecture:** Operating as a source-to-source compiler rather than a standalone binary interpreter.
*   **Accessibility:** Availability across multiple package managers including Arch Linux, MacPorts, and SlackBuilds.
*   **Open Development:** Hosting its source code repository on Sourcehut (`sr.ht`) rather than more common platforms like GitHub.

## Body

### Classification and Architecture
Fennel is identified as a **scripting language** and a **source-to-source compiler**. It falls under the broad classification of **Lisp**, a functional programming language rooted in lambda calculus. The primary design goal of Fennel is to provide a Lisp syntax that compiles directly to Lua, making it fully **compatible with Lua**.

### Technical Ecosystem
The language is supported by a robust set of online resources and development tools:
*   **Web Presence:** It maintains an official website in English and a dedicated wiki for documentation.
*   **File Handling:** The standard file format associated with the language is the **Fennel source code file**, used for both reading and writing data.
*   **Version Control:** Development is tracked via a repository hosted on Sourcehut, accessible via both HTTPS and Secure Shell (SSH) protocols.

### Distribution and Installation
Fennel is distributed natively through several major software repositories, facilitating easy installation for users on different operating systems:
*   **Arch Linux:** Available via the `fennel` package.
*   **MacPorts:** Available via the `lua-fennel` port.
*   **SlackBuilds:** Available under the category `development/Fennel`.

## References

1. [Source](https://fennel-lang.org/tutorial)