phel-lang/phel-lang

Phel is a functional programming language that transpiles to PHP

Fund package maintenance!
chemaclass.com/sponsor

Installs: 2 276

Dependents: 14

Suggesters: 0

Security: 0

Stars: 438

Watchers: 10

Forks: 22

Open Issues: 5

v0.18.0 2025-06-09 16:56 UTC

README

Phel logo

GitHub Build Status Scrutinizer Code Quality Scrutinizer Code Coverage Psalm Type-coverage Status Gitter Chat

Phel is a functional programming language that transpiles to PHP.

It is a dialect of Lisp inspired by Clojure and Janet, designed for building robust applications in the PHP ecosystem.

Example

# Define a namespace
(ns my\example)

# Define a variable with name "my-name" and value "world"
(def my-name "world")

# Define a function with name "print-name" and one argument "your-name"
(defn print-name [your-name]
  (print "hello" your-name))

# Call the function
(print-name my-name)

Documentation

  • Website
    • Features, documentation, exercises and blog
  • Installation
    • Quick start with scaffolding or manual installation
  • Packagist
    • The PHP Package Repository
  • Internals
    • Additional documentation about the compiler internals

Community

Feel free to ask questions and join discussions on the Phel Gitter channel.

Build PHAR

Run the following command to create a standalone PHAR executable:

./build/phar.sh

The generated build/out/phel.phar can then be executed directly.

Contribute

Please refer to CONTRIBUTING.md for information on how to contribute to Phel.