News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jani Hartikainen:
Parsing and evaluating PHP in Haskell Part 1
January 17, 2013 @ 11:13:23

Jani Hartikainen has posted the first part of a series of articles sharing his experiences with an experiment he's conducting - trying to parse and evaluate PHP in Haskell.

The other day I uploaded a new experimental project on GitHub - A Haskell PHP parser / evaluator. It doesn't understand 100% of all PHP syntax, but it was an interesting experiment nevertheless. Here's some insights and other thoughts from working on the code.

He gets the "why?" question out of the way early, noting that it was mainly a desire to play with Haskell and figured parsing something he already knew well was a good first project. He also mentions the "Parsec" library that seems well suited for the parsing part of the process. There were some issues that he came across, however including dealing with PHP's weak typing and handling all of the possible incarnations of PHP script structure. He includes an example AST showing his different data structures (PHPValue, PHPExpr and PHPStmt). The next part of the series will be more about the evaluation of this structure.

0 comments voice your opinion now!
parsing evaluation source haskell project experiment


blog comments powered by Disqus

Similar Posts

Raphael Stolt's Blog: Scaffolding, implementing & using project specific Zend_Tool_Project_Provider

Community News: phpDocumentor Merges with DocBlox for phpDocumentor 2!

Job Posting: White October Ltd Seeks Technical Project Manager (Oxford, UK)

Engine Yard Blog: Engine Yard Is Sponsoring Composer

The Northclick Blog: Message Queue Project: First working version


Community Events





Don't see your event here?
Let us know!


extension release opinion community voicesoftheelephpant version list symfony series interview configure api unittest composer podcast language introduction install conference laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework