We all love PHP's power. Easy to use, deployed everywhere. It is often the tool of choice when you begin programming. But soon, you feel that the language is fighting against you. Weird syntax, failing options, etc.
Here comes POD
POD is a new language, very close to PHP, but with a simpler syntax, easier to read, easier to type. It directly translates to PHP, so you will be able to use it everywhere, and profit from the uncountable number of PHP libraries already available.
<html> <head></head> <body> <? a = "Hello " + "World!" ?> <h1><? print a ?></h1> <? A = { -\ value +/ mul = (x, y) -> { ret x * y } -/ __construct = (val) -> { this.value = val } -/ show = () -> { print this.value } } str = "<script>alert('pouet')</script>" obj = new A(str) obj.show() ?> </body> </html>
<html> <head></head> <body> <?php $a = "Hello " . "World!"; ?> <h1><?php print htmlentities($a); ?></h1> <?php class A{ private $value; static public function mul($x, $y){ return $x * $y; } public function __construct($val){ $this->value = $val; } public function show(){ print htmlentities($this->value); } }; $str = "<script>alert('pouet')</script>"; $obj = new A($str); $obj->show(); ?> </body> </html>
$ ./bin/pod.php myfile.pod
POD is a monadic parser combinator written in PHP using the excellent PHPZ library to bring the power of typeclasses to PHP. The parser is easy to extend, with lots of unit tests to prevent errors, so don't hesitate to hack on it!
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/Geal/pod