phel-lang  by phel-lang

A Lisp-inspired language compiling to PHP

Created 6 years ago
506 stars

Top 61.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Phel is a functional, Lisp-inspired language that compiles to PHP, aiming to bring Clojure-like features such as macros and persistent data structures to the PHP ecosystem. It enables developers to adopt more robust, declarative, and expressive programming styles within the widely-used PHP environment.

How It Works

Phel translates Lisp-like syntax and functional programming paradigms into standard PHP code. Its design emphasizes immutability and declarative patterns, supported by macros for metaprogramming and persistent data structures for efficient state management. This compilation strategy allows developers to write code in a functional style while leveraging the PHP runtime's broad compatibility and performance.

Quick Start & Requirements

  • Installation: composer require phel-lang/phel-lang
  • Scaffolding: ./vendor/bin/phel init
  • Running: ./vendor/bin/phel run src/phel/main.phel
  • Testing: ./vendor/bin/phel test
  • REPL: ./vendor/bin/phel repl
  • Compilation: ./vendor/bin/phel build (compiles to PHP)
  • Eval: Inline code execution via ./vendor/bin/phel eval.
  • Minimal Setup: ./vendor/bin/phel init --minimal for single-file projects.
  • Documentation: Quick Start (5-minute tutorial), Installation guide.

Highlighted Details

  • Supports functional data pipelines via threading macros (->>).
  • Includes utilities for building HTTP responses.
  • Features a macro system for compile-time code generation and abstraction.
  • Offers seamless interoperation with existing PHP code, including class instantiation and member access.

Maintenance & Community

The provided README snippet does not detail specific maintainers, sponsorships, or community channels. It directs potential contributors to CONTRIBUTING.md.

Licensing & Compatibility

The specific license is not mentioned in the provided text, making commercial use compatibility uncertain.

Limitations & Caveats

Phel's runtime behavior is dependent on the generated PHP code and the PHP interpreter. Specific limitations regarding unsupported PHP versions or complex interop edge cases are not detailed. The absence of explicit licensing information presents a potential adoption risk.

Health Check
Last Commit

12 hours ago

Responsiveness

Inactive

Pull Requests (30d)
298
Issues (30d)
196
Star History
27 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elvis Saravia Elvis Saravia(Founder of DAIR.AI).

DeepCode by HKUDS

0.4%
16k
AI agents transform ideas into production-ready code
Created 1 year ago
Updated 1 week ago
Feedback? Help us improve.