<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 12:36:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jani Hartikainen: Parsing and evaluating PHP in Haskell: Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19079</guid>
      <link>http://www.phpdeveloper.org/news/19079</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has posted the <a href="http://codeutopia.net/blog/2013/01/23/parsing-and-evaluating-php-in-haskell-part-2/">second article</a> in his series looking at parsing PHP with Haskell (part one is <a href="http://phpdeveloper.org/news/19052">here</a>). In this new article he builds on the parser he built last time and gets to the actual evaluation of the PHP code.
</p>
<blockquote>
Last week I wrote a post about a PHP parser / evaluator I wrote in Haskell. I explained some of the parts on how the parser itself was designed to process PHP code into an abstract source tree. Continuing from where we left off in the <a href="http://codeutopia.net/blog/2013/01/16/parsing-and-evaluating-php-in-haskell-part-1/">previous part</a>, in this post I'll discuss the actual evaluation part.
</blockquote>
<p>
He starts by introducing the structure of the evaluator script, how it's broken up into functionality based on the type of object/data type being handled. He uses a "custom monad transformer stack" to handle the environment for the evaluation as is progresses. He talks about handling statements and expressions, declaring custom functions and the actual execution of the function call. There's also a mention of handling conditionals/looping as well as dealing with PHP's type juggling. 
</p>
<p>
if you're interested in seeing the final result (and maybe trying it out for yourself) you can find the <a href="https://github.com/jhartikainen/hs-language-php">full source on Github</a>.
</p>]]></description>
      <pubDate>Wed, 23 Jan 2013 11:24:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen: Parsing and evaluating PHP in Haskell: Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/19052</guid>
      <link>http://www.phpdeveloper.org/news/19052</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has posted the <a href="http://codeutopia.net/blog/2013/01/16/parsing-and-evaluating-php-in-haskell-part-1/">first part of a series</a> of articles sharing his experiences with an experiment he's conducting - trying to <a href="https://github.com/jhartikainen/hs-language-php">parse and evaluate PHP in Haskell</a>.
</p>
<blockquote>
The other day I uploaded a new experimental project on GitHub - A <a href="https://github.com/jhartikainen/hs-language-php">Haskell PHP parser / evaluator</a>. 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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Thu, 17 Jan 2013 11:13:23 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Web & PHP Magazine: Issue #7 Published - "Full Throttle"]]></title>
      <guid>http://www.phpdeveloper.org/news/18582</guid>
      <link>http://www.phpdeveloper.org/news/18582</link>
      <description><![CDATA[<p>
The latest issue of the Web & PHP Magazine has been published - <a href="http://webandphp.com/Issue7">Issue #7</a>, "Full Throttle". Articles included in this issue are:
</p>
<ul>
<li>Introduction into scaling for Big Data: Cory Isaacson's new column
<li>What can developers learn from the road? - By Arne Blankerts
<li>How to be an open source rockstar in 7 easy steps -  By Jen Kramer
<li>PHP security for the real world - By Michael Stowe
<li>Developing Web Applications in Haskell -  By Patrick Brisbin
<li>Speed up your applications using IIS & WinCache - By Arno Hollosi
</ul>
<p>
You can download this latest issue for free <a href="http://webandphp.com/Issue7">as a PDF</a> as well as picking up the past 6 issues with some great PHP-related content inside.
</p>]]></description>
      <pubDate>Wed, 10 Oct 2012 11:49:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Species Blog: Lazy evaluation with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16410</guid>
      <link>http://www.phpdeveloper.org/news/16410</link>
      <description><![CDATA[<p>
<i>Juozas Kaziukenas</i> has a new post to his Web Species blog about <a href="http://blog.webspecies.co.uk/2011-05-31/lazy-evaluation-with-php.html">using "lazy evaluation" in PHP</a> - loading the resources you need for execution and evaluation only as you need them, not all up front.
</p>
<blockquote>
Recently I needed to process a huge array of data and because of PHP's somewhat inefficient variables and especially arrays that was resulting in "out of memory" errors. However, I couldn't use any other tools than PHP so was forced to come up with a solution implementation in it. Here is how I solved it using principles from functional languages.
</blockquote>
<p>
He gives an example using Haskell to generate a Fibonacci sequence using its built-in lazy evaluation abilities. Unfortunately, PHP doesn't have such a thing built in, so he tries the next best thing - <a href="http://php.net/manual/en/class.iterator.php">Iterators</a>. He caries the idea over to the database side too, recommending fetch() in a loop over fetchAll() and some effective joins.
</p>]]></description>
      <pubDate>Wed, 01 Jun 2011 08:41:01 -0500</pubDate>
    </item>
  </channel>
</rss>
