Download the PHP package webgraphe/phlip without Composer
On this page you can find all versions of the php package webgraphe/phlip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webgraphe/phlip
More information about webgraphe/phlip
Files in webgraphe/phlip
Package phlip
Short Description Embeddable scripts for PHP
License MIT
Homepage https://github.com/webgraphe/phlip
Informations about the package phlip
Embeddable scripts for PHP
Phlip (pronounced \ˈflip\) is an embeddable scripting language for PHP based on s-expressions.
How does it work?
A lexer tokenizes scripts and a parser assembles data structures. A script's behavior originates from data and code elements resolved from a controlled scope.
Integration is simpler with the Phlipy dialect.
Refer to Webgraphe\Phlip\Tests\Unit\ReadmeTest for the example below:
How to install
Add a dependency on your projects with Composer, using
composer require webgraphe/phlip.
You may also install it globally with composer global require webgraphe/phlip.
Why use Phlip
- Embeddable scripts mean data becomes code
- Easy to use
- Easy to learn
- Build your own dialect!
- Interoperable with PHP Classes
- Create test suites with
phlipunit(built on top of PHPUnit) - Ships with a literal REPL
(loop (print (eval (read))))
DISCLAIMER
Lisp is a often considered a Homoiconic (code as data) language.
Despite Phlip's usage of S-expressions and a somewhat successful attempt at reproducing McCarthy's eval, as the author
I do not consider Phlip be an homoiconic language as it relies on PHP's internal data structures such as array,
stdClass, native scalars, Closure and invokable classes for performance and convenience.
Phlip is embeddable in PHP and was built to allow transportation of code and data in a manner that can stay relatively secure, provided that functionalities interoperable with PHP stay in check.
For reference: Webgraphe\Phlip\Tests\System\LispTest::testMcCarthyEval()