Phel v0.36.0 – Lisp on PHP, now with numeric tower and first-class Vars

Hacker News Top Tools

Summary

Phel v0.36.0 is released, bringing a numeric tower and first-class Vars to the Lisp-inspired functional language that compiles to PHP.

No content available
Original Article Export to Word Export to PDF
View Cached Full Text

Cached at: 05/11/26, 09:49 AM

phel-lang/phel-lang

Source: https://github.com/phel-lang/phel-lang

Phel logo

GitHub Build Status PHPStan level 6 Psalm level 1 Psalm Type-coverage Status

Packagist Version Packagist Downloads PHP Version Required License Ask DeepWiki


Functional, Lisp-inspired language compiling to PHP. Macros, persistent data structures, REPL.

Example

(ns my.example)

(defn greet [name] (str "Hello, " name "!"))

(println (greet "Phel"))
;; => Hello, Phel!
More examples →

Data pipeline

(def users
  [{:name "Ada" :age 36}
   {:name "Bob" :age 17}
   {:name "Cam" :age 41}])

(->> users
     (filter #(>= (:age %) 18))
     (map :name)
     sort)
;; => ["Ada" "Cam"]

HTTP response

(ns app (:require phel.http :as h))

(def req (h/request-from-globals))

(h/emit-response
  (h/response-from-map
    {:status 200
     :headers {"Content-Type" "text/plain"}
     :body (str "Hello " (:uri req))}))

Macros

(defmacro unless [pred & body]
  `(if (not ,pred)
     (do ,@body)))

(unless (zero? 1)
  (println "not zero"))
;; => not zero

(unless false (println "ok"))
;; => ok

PHP interop

(ns app)

(def now (php/new \DateTime))
(.format now "Y-m-d")
;; => "2026-04-20"

(def epoch (php/new \DateTime "1970-01-01"))
(.-days (.diff now epoch))
;; => 20564

Getting Started

composer require phel-lang/phel-lang
./vendor/bin/phel init                     # add `--minimal` for a single-file layout

Scaffolds phel-config.php, src/phel/main.phel, tests/phel/main_test.phel.

./vendor/bin/phel run src/phel/main.phel   # run
./vendor/bin/phel test                     # tests
./vendor/bin/phel repl                     # REPL
./vendor/bin/phel build                    # compile to PHP

Eval inline or via stdin:

./vendor/bin/phel eval '(+ 1 2)'           # prints 3
echo '(println "hi")' | ./vendor/bin/phel eval -
./vendor/bin/phel eval - < script.phel

Documentation

AI coding agents

  • resources/agents/ — Claude Code, Cursor, Codex, Gemini, Copilot, Aider
  • ./vendor/bin/phel agent-install [platform] [--all] — install skill file for your agent

Build PHAR

./build/phar.sh produces build/out/phel.phar.

Contribute

Setup and workflow: CONTRIBUTING.md. Architecture and review expectations: AGENTS.md.

Similar Articles

Pyrefly v1.0 is here

Lobsters Hottest

Pyrefly, an open-source Python type checker and language server, reaches v1.0, marking production readiness with significant performance improvements and adoption by major codebases like PyTorch and NumPy.

vllm-project/vllm v0.20.1

GitHub Releases Watchlist

vLLM v0.20.1 is a minor version update for the popular open-source LLM inference and serving library, maintaining its focus on high-throughput and efficient memory management.

vllm-project/vllm v0.21.0rc1

GitHub Releases Watchlist

vLLM v0.21.0rc1 is a pre-release update for the high-performance LLM inference and serving library, featuring optimizations for throughput, quantization, and hardware support.

Mojo v1.0.0b1

Lobsters Hottest

Mojo, the high-performance programming language from Modular, has reached version 1.0.0 beta 1.