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-fix/1286-range-infinite-equality
- dev-feat/1325-bigint-bigdec-literals
- dev-feat/1330-char
- dev-feat/1327-byte
- dev-feat/1321-aclone
- dev-feat/1320-to-array
- dev-feat/1319-array-map
- dev-feat/1318-object-array
- dev-feat/1317-var-quote-reader-syntax
- dev-feat/1316-def-inside-def
- dev-feat/1315-assert-var
- dev-feat/1313-future-follow-ups
- dev-feat/1287-future-macro
- dev-fix/1304-reset-swap-return-value
- dev-fix/1303-associative-vector
- dev-fix/1305-vec-hash-map-entries
- dev-fix/1306-min-max-key-tie-break
- dev-fix/1307-thrown-single-arg
- dev-feat/1299-named-fn-self-binding
- dev-feat/1283-character-literals
- dev-feat/1276-hash-dispatch-syntax
- dev-feat/1279-named-fn-syntax
- dev-feat/1281-radix-number-literals
- dev-fix/1278-negative-hex-int-min
- dev-fix/1280-are-empty-list
- dev-fix/1275-trailing-quote-in-symbols
- dev-fix/1286-lazyseq-identity-equality
- dev-feat/1285-disj
- dev-feat/1282-float-double-coercion
- dev-feat/1274-sorted-predicate
- dev-feat/1284-nan-predicate
- dev-feat/793-pmap
- dev-feat/amphp-as-runtime-dependency
- dev-ref/793-fn-emit-closure
- dev-fix/793-yield-return-context
- dev-feat/793-async-module
- dev-fix/793-run-output-buffering
- dev-feat/1226-add-reify
- dev-fix/1263-require-dot-separator-repl
- dev-feat/1260-add-do-report-to-test
- dev-feat/1228-sorted-collections
- dev-feat/1259-range-zero-arity-infinite-sequence
- dev-feat/1251-dot-separator-fqn-resolution
- dev-feat/1255-add-are-to-phel-test
- dev-docs/1229-clojure-migration-guide
- dev-feat/1252-clojure-compatible-aliases
- dev-feat/1224-letfn-macro
- dev-feat/1246-throw-on-missing-require
- dev-feat/1219-or-defaults-map-destructuring
- dev-fix/1230-reserved-keywords-namespace
- dev-feat/1227-strs-map-destructuring
- dev-feat/1225-fnil
- dev-feat/1223-vary-meta
- dev-feat/1222-assert-macro
- dev-feat/1221-min-key-max-key
- dev-feat/1220-rename-keys
- dev-feat/1218-if-some-when-some-when-first
- dev-feat/1237-testing-macro
- dev-feat/1231-seq-predicate
- dev-feat/1217-condp-macro
- dev-fix/clojure-remap-declared-namespace-check
- dev-fix/1210-clojure-remap-only-existing-ns
- dev-fix/1209-macroexpand-quoted-forms
- dev-fix/1208-macroexpand-non-macro-forms
- dev-feat/1211-require-quoted-symbols
- dev-feat/1207-clojure-namespace-aliasing
- dev-docs/sync-recent-features
- dev-feat/1203-deprecate-dollar-gensym
- dev-feat/1203-deprecate-comma-unquote
- dev-fix/1201-map-even-params-quoted
- dev-fix/1195-defmethod-bracket-matching
- dev-ref/seq-generator-split
- dev-ref/zipper-guards-and-helpers
- dev-ref/global-environment-collaborators
- dev-feat/1188-assert-expr-multimethod
- dev-feat/1187-global-resolve
- dev-feat/1186-boolean-function
- dev-feat/1185-defmacro-env-form
- dev-feat/1184-some-clojure-compat
- dev-feat/1183-clojure-compatible-require
- dev-feat/1177-dot-namespace-separator
- dev-fix/1180-test-runner-php-namespaced-function
- 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-11 13:50:10 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
- Clojure Migration Guide Coming from Clojure? Key differences, interop cheat sheet, and what's the same.
- 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.