phel-lang / phel-lang
Phel is a functional programming language that compiles to PHP
Fund package maintenance!
v0.31.0
2026-04-03 12:17 UTC
Requires
- php: >=8.3
- gacela-project/gacela: ^1.12
- phpunit/php-timer: ^6.0|^7.0|^8.0
- symfony/console: ^6.0|^7.0|^8.0
Requires (Dev)
- ext-readline: *
- ergebnis/composer-normalize: ^2.50
- friendsofphp/php-cs-fixer: ^3.94
- phpbench/phpbench: ^1.6
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5
- psalm/plugin-phpunit: ^0.19
- rector/rector: ^2.3
- symfony/var-dumper: ^7.4
- vimeo/psalm: ^6.16
- dev-main
- v0.31.0
- v0.30.0
- v0.29.0
- v0.28.0
- v0.27.0
- v0.26.0
- v0.25.0
- v0.24.0
- v0.23.1
- v0.23.0
- v0.22.2
- v0.22.1
- v0.22.0
- v0.21.0
- v0.20.0
- v0.19.1
- v0.19.0
- v0.18.1
- v0.18.0
- v0.17.0
- v0.16.1
- v0.16.0
- v0.15.3
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.1
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.0
- v0.10.1
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
- dev-ref/deprecate-pipe-fn-syntax
- dev-fix/cljc-file-discovery
- dev-docs/developer-onboarding
- dev-docs/optimize-agentic-coding
- dev-feat/reader-conditional-splicing
- dev-feat/1171-reader-conditionals
- dev-fix/nrepl-require-ns-output
- dev-feat-add-getphelfunctions-fnsignature-docstring
- dev-codex/fix-broken-macro-definitions-in-user-namespace
- dev-feat/support-php83
This package is auto-updated.
Last update: 2026-04-04 13:54:29 UTC
README
Phel is a functional, Lisp-inspired programming language that compiles to PHP. It brings the expressive power of Clojure and the simplicity of Janet to the PHP ecosystem — enabling you to write concise, immutable, and composable code that runs anywhere PHP does.
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
Getting Started
- Quick Start Tutorial Get up and running in 5 minutes with your first Phel application.
- Installation Detailed installation guide and project setup.
Learning Resources
- Common Patterns Idiomatic Phel code patterns for everyday tasks.
- PHP/Phel Interop Complete guide to working between PHP and Phel code.
- Reader Shortcuts Reference for all special syntax and reader macros.
- Reader Conditionals
Cross-platform code with
#?(),#?@(), and.cljcfiles. - Transducers Composable transformation pipelines without intermediate collections.
- Data Structures Guide to Phel's persistent, immutable collections.
- Lazy Sequences Performance patterns and common pitfalls.
- Mocking Guide Testing with mocks and test doubles.
- Examples Runnable code samples covering key features.
Reference
- Website Official website with tutorials, exercises, and blog posts.
- Packagist Official PHP package repository.
- Internals Deep dive into the compiler architecture.
- Repository Guidelines Project structure, modules, build commands, and review expectations.
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
| Resource | What's there |
|---|---|
| CONTRIBUTING.md | Setup, workflow, testing, and PR guidelines |
| Repository Guidelines | Architecture, modules, build commands, review expectations |
| docs/ | Guides, examples, and compiler internals |
| phel-lang.org | Tutorials, exercises, and blog posts |
New here? Start with CONTRIBUTING.md — it explains the two-language codebase and has a "Where to Start" section based on your interests.