Re: PHP compiler

From: Manuel Lemos (mlemos_at_acm.org)
Date: 03/10/04


Date: Tue, 09 Mar 2004 20:24:54 -0300

On 03/09/2004 10:35 AM, Lothar Scholz wrote:
>>He never said that he wanted to develop a compiler that generates an
>>executable that works by itself. Anybody can develop a compiler that
>>links to libphp.a and the necessary parts of Zend engine. Over time the
>>compiler could be optimized to replace some PHP function calls with
>>native C code.
>>
>
>
> But i'm 100% sure that this is nothing for a university compiler

Why not?

> course. Maybe it is if you only teach the tokenizer and lexical
> parser. But this should take no longer then a month. Everything else
> is for educational things just stupid. Writing an interpreter is a
> good home work assignment, i did this with a lisp interpreter in my
> student days, but using PHP in a compiler course. Oh my Buddha, please
> help the unwise.

What you are suggestiong seems pointless. PHP engine itself since
version 4 is already a compiler that converts PHP source and byte codes.
Writing an interpreter is like going back to the slow PHP 3 days.

If anybody writes a tool that converts PHP bytecodes into C/C++ code
that when executed does the same as when the original bytecodes are
interpreted by the Zend engine, that is also a compiler tool to me. And
yes, the base project could be developed in a month much more likely
than a PHP source to binary executable project.

-- 
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Relevant Pages

  • Re: Delphi has ruined me. Ruined, I tell you, ruined.
    ... With no compiler, its the gateway drug to bad programming. ... I guess I should start going around to websites and hacking ... type PHP habitual programming for constructive purposes. ... But this does go beyond just compiler type checking. ...
    (borland.public.delphi.non-technical)
  • Re: [SOLVED] php5-mysql? (with added bonus for snort)
    ... make install of php5 and of mysql but no luck so far. ... Configured with: FreeBSD/i386 system compiler ... configure:2823: checking build system type ... configure:2974: checking for PHP includes ...
    (freebsd-questions)
  • Re: Compiled PHP Questions
    ... > eyes so that I can deploy custom web-applications on a customer's ... That is the problem with PHP. ... PHP was developed as an open-source ... compiler produces is identical to the one cached PHP code has. ...
    (alt.php)
  • Re: PHP compiler
    ... Anybody can develop a compiler that ... i did this with a lisp interpreter in my ... but using PHP in a compiler course. ... interpreted by the Zend engine, that is also a compiler tool to me. ...
    (alt.php)
  • Re: String to int conversion
    ... an interpreter produces its results by some other means. ... if it *was* converted in chunks into actual machine code to be ... compiler available. ... in order to execute however many lines exist in the script. ...
    (microsoft.public.scripting.vbscript)