473,473 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP compiler

Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #1
34 3644
Nikola Skoric wrote:
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


oh you sick freak. You want compiled binaries for what reason?
efficiency??? use a language that allows efficiency then...

mwhaha...

J
Jul 17 '05 #2
Hi J,
On Sun, 07 Mar 2004 23:57:47 +0000, J Taylor <jt@imen.org.uk> wrote:
Nikola Skoric wrote:
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...

oh you sick freak. You want compiled binaries for what reason?
efficiency??? use a language that allows efficiency then...


He might want it to distribute it to people that are not able to set
up a webserver.

if this is the case, have a look at MicroWeb. Its not free though.

HTH, Jochen

mwhaha...

J


--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #3
Jochen Daum <jo*********@cans.co.nz> wrote in message news:<rf********************************@4ax.com>. ..

He might want it to distribute it to people that are not able to set
up a webserver.

if this is the case, have a look at MicroWeb. Its not free though.


But then he should write a simple executable that starts apache with
the right config file. The only real reason for a compiler is to
protect the copyright of your source code. And for this there is a
zend solution availabl.e
Jul 17 '05 #4
In article <6e**************************@posting.google.com >,
ll*****@web.de says...
Jochen Daum <jo*********@cans.co.nz> wrote in message news:<rf********************************@4ax.com>. ..

He might want it to distribute it to people that are not able to set
up a webserver.

if this is the case, have a look at MicroWeb. Its not free though.


But then he should write a simple executable that starts apache with
the right config file. The only real reason for a compiler is to
protect the copyright of your source code. And for this there is a
zend solution availabl.e


Zend solution? Can you explaint that a little bit?

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #5
In article <40***********************@news-text.dial.pipex.com>,
jt@imen.org.uk says...
Nikola Skoric wrote:
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


oh you sick freak. You want compiled binaries for what reason?
efficiency??? use a language that allows efficiency then...

mwhaha...


No. See, you didn't understand my question correctly. I don't actually
need a PHP compiler, what I need is an *information* wether that
compiler exists. And why's that? Becouse my team and I might be doing a
PHP compiler as a student project for my Comiler Design course at
University (I, as a group leader, have 10 people and 4 months on my
hands to build a comiler of my own). So, it would be very nice to have
"nobody did it before" in my project documentation. And I can write that
if I'm not sure, right?

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #6
Nikola Skoric wrote:
(...)
Zend solution? Can you explaint that a little bit?


"Starting at $960":
http://www.zend.com/store/products/zend-encoder.php

Rudi
Jul 17 '05 #7
That would be a nice thing to do.

AFAIK, so far there is a PHP compiler that creates code that is interpreted
by another executable. That is the case of "Zend Encoder" and "Zend
Optimizer" that runs the compiled code. Guess this can be classified as
Java: bytecode generator and an interpreter.

--
Elias
"Nikola Skoric" <ni*******@net4u.hr> wrote in message
news:MPG.1ab64a8fe5f7ea1198971a@localhost...
In article <40***********************@news-text.dial.pipex.com>,
jt@imen.org.uk says...
Nikola Skoric wrote:
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


oh you sick freak. You want compiled binaries for what reason?
efficiency??? use a language that allows efficiency then...

mwhaha...


No. See, you didn't understand my question correctly. I don't actually
need a PHP compiler, what I need is an *information* wether that
compiler exists. And why's that? Becouse my team and I might be doing a
PHP compiler as a student project for my Comiler Design course at
University (I, as a group leader, have 10 people and 4 months on my
hands to build a comiler of my own). So, it would be very nice to have
"nobody did it before" in my project documentation. And I can write that
if I'm not sure, right?

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!

Jul 17 '05 #8
On 2004-03-08, Nikola Skoric wrote:
In article <40***********************@news-text.dial.pipex.com>,
jt@imen.org.uk says...
Nikola Skoric wrote:
> Is the a PHP compiler? A program that compiles PHP code to executable
> which doesn't need php interpreter to execute...
>


oh you sick freak. You want compiled binaries for what reason?
efficiency??? use a language that allows efficiency then...

mwhaha...


No. See, you didn't understand my question correctly. I don't actually
need a PHP compiler, what I need is an *information* wether that
compiler exists. And why's that? Becouse my team and I might be doing a
PHP compiler as a student project for my Comiler Design course at
University (I, as a group leader, have 10 people and 4 months on my
hands to build a comiler of my own). So, it would be very nice to have
"nobody did it before" in my project documentation. And I can write that
if I'm not sure, right?

There have been a few projects started along these lines but none seem
to have reached any kind of usable solution yet. There was a thread
discussing this on the php-internals mail list recently which mentions
some of the projects and issues. You can follow the thread from the
archives here:
http://marc.theaimsgroup.com/?l=php-...7956215002&w=2

HTH
--
Mike Peters
mike [-AT-] ice2o [-DOT-] com
http://www.ice2o.com
Jul 17 '05 #9
Nikola Skoric wrote:
In article <40***********************@news-text.dial.pipex.com>,
jt@imen.org.uk says...
Nikola Skoric wrote:

Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


oh you sick freak. You want compiled binaries for what reason?
efficiency??? use a language that allows efficiency then...

mwhaha...

No. See, you didn't understand my question correctly. I don't actually
need a PHP compiler, what I need is an *information* wether that
compiler exists. And why's that? Becouse my team and I might be doing a
PHP compiler as a student project for my Comiler Design course at
University (I, as a group leader, have 10 people and 4 months on my
hands to build a comiler of my own). So, it would be very nice to have
"nobody did it before" in my project documentation. And I can write that
if I'm not sure, right?


Out of interest I have seen a set of php scripts (non free and
non-public) which convert php code (limited scope) into C or Java source
code, then call gcc | javac.

This is slightly more efficient way of writing a "quick" compiler as the
devlopers take advantage over the gcc and javac developers time and
effort in writing the compiler technology as opposed to having to
develop all the code optimisers themselves.

However I still oppose the idea of handing out a php compiler - if it
could not actually produce efficient code, is handing out this tool
going to promote peoples use of it?

J
Jul 17 '05 #10
"lallous" <la*****@lgwm.org> wrote in message news:<c2*************@ID-161723.news.uni-berlin.de>...
That would be a nice thing to do.

AFAIK, so far there is a PHP compiler that creates code that is interpreted
by another executable. That is the case of "Zend Encoder" and "Zend
Optimizer" that runs the compiled code. Guess this can be classified as
Java: bytecode generator and an interpreter.


I looked at the 5.0 source code last week and it seems to be built in
now. At least there is a bytecode maybe not an optimized one, but i
don't know what could be really optimized.
Jul 17 '05 #11
In article <40***********************@news-text.dial.pipex.com>,
jt@imen.org.uk says...
However I still oppose the idea of handing out a php compiler - if it
could not actually produce efficient code, is handing out this tool
going to promote peoples use of it?


That question is of no importance to me at this point. Now my main
concern is to get as much points for my crew and me, so we could get
better grades. *BUT* as I have great intrest in optimizing algorithms,
and I'm still 2 years away from my University diploma, there is a great
probability that I might be doing some optimizing to... and after I'm
finished with the project it would be a realy nice start for a PHP
compiler... if my University alowes me to publish it under GPL.

<egomaniac>
After all, Linux too was born as a student project, right? :-)
</egomaniac>

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #12
Nikola Skoric a écrit le 07/03/2004 :
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


Do you know Google? 509000 answers and out of this in 2mn :
Individuals Projects running :
PHPblender
PHP|Architect
PHP_Sharp
(none seem to be completed)

Commercial solutions :
www.ioncube.com
www.Zend.com
Jul 17 '05 #13
Nikola Skoric wrote:
In article <40***********************@news-text.dial.pipex.com>,
jt@imen.org.uk says...
However I still oppose the idea of handing out a php compiler - if it
could not actually produce efficient code, is handing out this tool
going to promote peoples use of it?

That question is of no importance to me at this point. Now my main
concern is to get as much points for my crew and me, so we could get
better grades. *BUT* as I have great intrest in optimizing algorithms,
and I'm still 2 years away from my University diploma, there is a great
probability that I might be doing some optimizing to... and after I'm
finished with the project it would be a realy nice start for a PHP
compiler... if my University alowes me to publish it under GPL.


mmm you might then be interested in compiling to some other bytecode -
you could compile to native but you might also want to try compiling a
set of functions (remembering that the entire php compiler spaning all
function calls would take a long time (years)). you could compile a set
of standardised functions into corresponding byte code.

You might also want to look at the fact that PHP itself uses library
calls so most of the function code will be allready written for you - in
this case you might be faster generating C code and compiling that. Are
there any PHP developers on the list?

<egomaniac>
After all, Linux too was born as a student project, right? :-)
</egomaniac>


IIRC not as a university project.
<recall title="top ten flame wars of the past">Indeed, Tanenbaum (who
although might be as communicative as a trout, is possibly the worlds
best authority on Operating Systems), claimed (with good reason) that
Linux was written and designed in the wrong manner, and that if it had
been written for His course, then Linus would have been failed.
Interestingly enough, it seems Linus only even bothered to write it
because he was bored of playing Prince of Persia... Linus Torvalds - a
game geek at heart?</recall>

J
Jul 17 '05 #14
"Nikola Skoric" <ni*******@net4u.hr> wrote in message
news:MPG.1ab64a8fe5f7ea1198971a@localhost...
(snip)
No. See, you didn't understand my question correctly. I don't actually
need a PHP compiler, what I need is an *information* wether that
compiler exists. And why's that? Becouse my team and I might be doing a
PHP compiler as a student project for my Comiler Design course at
University (I, as a group leader, have 10 people and 4 months on my
hands to build a comiler of my own). So, it would be very nice to have
"nobody did it before" in my project documentation. And I can write that
if I'm not sure, right?

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!

If I may say, if you have never written a compiler before, do attempt a php
compiler, stick to a language that is more suited for compiling.

PHP has too many functions, that can limit compiling, for example, the
require() function can be used like a C-style include, and compiled, but you
lose out on the include() function, becouse a lot of time people need to
include editable (such as forms erc..) files at run time, therefore those
files can not be compiled. Actualy even some require() files can not be
compiled, becouse they contain config variables that need to be editied by
the user.

So you compiler would have to have some added directives to tell it whether
to compile the require/include files, and it would have to have a built in
interpeter in the run time, so as to interpet the include files that were
not compiled. (also file scripts that use the eval command)

Here is an example:

main file:
<?php
include("sub.php");
print "Version: $ver\n";
print "Max allowed users: $maxUsers\n";
?>
include file, that can not be compiled becouse user has to define settings
sub.php
<?php
$ver = "1.0";
$maxUsers = 20;
?>
Also, there are a lot of people (my self included) that write admin pages
that write php config pages, that are included in a script, I also write
selfmodifying scripts.

Now I am not saying it can not be done, just rather complex due to the
robustness of php. This is why alot of compilers compile to P-Code. not true
cpu instructions.

Well you have one good advantage, you have access to the php source :)

Just my 2 cents.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #15
Hello,

On 03/08/2004 05:34 PM, CountScubula wrote:
No. See, you didn't understand my question correctly. I don't actually
need a PHP compiler, what I need is an *information* wether that
compiler exists. And why's that? Becouse my team and I might be doing a
PHP compiler as a student project for my Comiler Design course at
University (I, as a group leader, have 10 people and 4 months on my
hands to build a comiler of my own). So, it would be very nice to have
"nobody did it before" in my project documentation. And I can write that
if I'm not sure, right?

If I may say, if you have never written a compiler before, do attempt a php
compiler, stick to a language that is more suited for compiling.

PHP has too many functions, that can limit compiling, for example, the
require() function can be used like a C-style include, and compiled, but you
lose out on the include() function, becouse a lot of time people need to
include editable (such as forms erc..) files at run time, therefore those
files can not be compiled. Actualy even some require() files can not be
compiled, becouse they contain config variables that need to be editied by
the user.


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.

Actually, the compiler could be Just In Time (JIT) and be transparently
integrated in the PHP runtime execution for maximizing the performance
and keeping the flexibility.

--

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
Jul 17 '05 #16
Dana Mon, 08 Mar 2004 20:24:31 +0100,
Jedi121 <je*********@free.fr.Removethis> kaze:
PHP_Sharp


Hm, hm, this one is interesting. I myself have been thinking about
PHP -> MSIL compiler... Thanks for the tip!

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #17
Dana Mon, 08 Mar 2004 19:51:53 +0000,
J Taylor <jt@imen.org.uk> kaze:
Nikola Skoric wrote:
That question is of no importance to me at this point. Now my main
concern is to get as much points for my crew and me, so we could get
better grades. *BUT* as I have great intrest in optimizing algorithms,
and I'm still 2 years away from my University diploma, there is a great
probability that I might be doing some optimizing to... and after I'm
finished with the project it would be a realy nice start for a PHP
compiler... if my University alowes me to publish it under GPL.
mmm you might then be interested in compiling to some other bytecode -


Yes, I'm thinking about compiling to MSIL (.NET Framework language) because
of all the built in methods that would minimize the effort of writing the
built in functions. But, anyway, my compiler doesn't have to have more than
15 built in functions, my aim is to show to my teacher that I understand the
way compilers are dedigned, no to build a full scale compiler able to whash
the dishes...
you could compile to native but you might also want to try compiling a
set of functions (remembering that the entire php compiler spaning all
function calls would take a long time (years)).
That's the reason I don't have to be able to compile all ot PHP functions.
You might also want to look at the fact that PHP itself uses library
calls so most of the function code will be allready written for you - in
this case you might be faster generating C code and compiling that.
Hmmm... no, to complicated. Our course is about converting higher languages
to assembly languages, crosscompilation is not an option.
Are
there any PHP developers on the list?
Which list? :-)
<recall title="top ten flame wars of the past">Indeed, Tanenbaum


Is that the MINIX guy?

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #18
"Nikola Skoric" <ni*******@net4u.hr> wrote in message
news:MPG.1ab5b62d9e401c5c989718@localhost...
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


Nikola,

I have been thinkering about possibilites and implications of writing
another php implementation. My expirience is that first thing that you would
have to ask yourself is "What is PHP actually?". Is it just a core of the
language (syntax and semantics). Is the library also part of it? The whole
library or just some "core" parts of library? Is the web server interface
also part of the language implementation?

Here are most troublesome aspects I have came uppon:

* there is no formal definition of the language and the system. The whole
thing relies on the concept "implementation is definition". For instance
there is no formal description of the syntax, instead, you digg into the
bison and flex sources and hack your way from there. I still keep finding
things in implementation that make system behave differently than what I
would expect it normaly.

* library. It is a precious resource, more or less you can find interface to
allmost anything you would ever like to use. Anyway it is huge, and written
by many. Writing it from the scratch is mission impossible without very huge
resources. You can try to use existing library, and try to provide the same
interface from your execution environment, as original zend engine does so
that library feels at home. Anyway, while there are descriptions of that
interface, but I do not feel those descriptions have completness necessary
to mimic zend environment completely. Also it would still be possible that
in some library someone hacked a bit deeper than that and used some internal
knowledge of zend engine.

* if using the already exiting library you would have to choose wheater to
tray to use it in "binary compatible" or logically same way. Binary
compatible would save you from recompiling the library with all caveats that
might arouse, but forgetting the binary compatibility would allow you to at
least better fit execution model to your desires.

* you cold go mixed way with library, reimplement most important parts
(array strings ..) so that you can use your own execution envornment, and
use some tunneling to speak with old library for the rest.

* you could say that library is not part of php and implement just the core
of the language. This would of course be just an toy.

* Testing. How do you know that you have done good job in the end
(especially when you do not have formal definition avaliable)? Testing would
have to be massive in order to weed out not only bugs, but you
missunderstandings what php actually is.

* Legalize ... brr... Library has been written by many, and while my
understanfding of original Zensd licence is quite liberal, I have not read
all of the copyright notices in every single source for the library. There
could be some caveats.

Anyway, since we live in the same town, you could drop me an e-mail, and we
could meet for coffe or beer, and chat from time to time about our findings.

rush
--
http://www.templatetamer.com/
Jul 17 '05 #19
Manuel Lemos <ml****@acm.org> wrote in message news:<c2*************@ID-138275.news.uni-berlin.de>...
<snip>
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.


So, are you suggesting bcompiler
<http://pecl.php.net/package/bcompiler> or BinaryPHP
<http://sourceforge.net/projects/binaryphp/> ?

p.s.: I never used these tools.

--
"I don't believe in the God who doesn't give me food, but shows me
heaven!"--Swami Vivekanandha
Email: rrjanbiah-at-Y!com
Jul 17 '05 #20
Manuel Lemos <ml****@acm.org> wrote in message news:<c2*************@ID-138275.news.uni-berlin.de>...

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
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.
Jul 17 '05 #21
On Tue, 9 Mar 2004 10:15:31 +0000 (UTC),
Nikola Skoric <ni*******@net4u.hr> wrote:

--<snip>--
Yes, I'm thinking about compiling to MSIL (.NET Framework language) because
of all the built in methods that would minimize the effort of writing the
built in functions. But, anyway, my compiler doesn't have to have more than
15 built in functions, my aim is to show to my teacher that I understand the
way compilers are dedigned, no to build a full scale compiler able to whash
the dishes...


We were working on a Antlr parser for PHP, that is still incomplete yet.
But it does not actually contain any builtin PHP methods. It would just
parser to the point, where it's clear, that the current token is the name
of a builtin method. Then it should lookup the name in a list of methods,
that would reference the code to execute that method. So you could add
new methods dynamically without changing the parser.

Ciao,
Andreas

Jul 17 '05 #22
Hello,

On 03/09/2004 09:36 AM, R. Rajesh Jeba Anbiah 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.

So, are you suggesting bcompiler


No, AFAIK, bcompiler is a dead project.

<http://pecl.php.net/package/bcompiler> or BinaryPHP
<http://sourceforge.net/projects/binaryphp/> ?


Maybe it would be more like this but this project seems to be dead as well.

--

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
Jul 17 '05 #23
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
Jul 17 '05 #24
Manuel Lemos <ml****@acm.org> wrote in message news:<c2*************@ID-138275.news.uni-berlin.de>...

Why not?
You never took a compiler construction course in a university right ?
It makes no sense because the semantik analyse and type interference
are the more important parts. Writing parsers for simple grammers are
done in the second year. And then there is something like register
optimization etc.
Of course it is interesting to do a JIT compiler but nothing for
students course.

I only feel sorry for the poor students who have such teachers.
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.


Dynamical typing makes this impossible if you don't change the
language with typedefs, if you do it will look like a interpreter. And
a bytecode compiler is still to a huge part nothing more then an
inpreter.
Jul 17 '05 #25
Hello,

On 03/10/2004 03:34 AM, Lothar Scholz wrote:
Why not?

You never took a compiler construction course in a university right ?
It makes no sense because the semantik analyse and type interference
are the more important parts. Writing parsers for simple grammers are
done in the second year. And then there is something like register
optimization etc.
Of course it is interesting to do a JIT compiler but nothing for
students course.

I only feel sorry for the poor students who have such teachers.


Maybe, but the world is wide and not every university is equal
everywhere in the world. So, it is possible that for the original poster
university, the teachers could be more open minded and accept different
types of project proposals.

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.

Dynamical typing makes this impossible if you don't change the
language with typedefs, if you do it will look like a interpreter. And
a bytecode compiler is still to a huge part nothing more then an
inpreter.


I don't know how much you know from what Zend op codes that the Zend
engine executes at run time. What I can tell you is that plenty can be
done to benefit from compilation to C/C++ .

Even if no significant speedup would be possible, the fact that it would
generate a binary executable would be already a benefit for those that
would like to provide their code in easy to reverse-engineer format.

In fact, one of the major reasons why PHP is not taken seriously in the
business world is the lack of real binary compiler tools or at least
tools that let you bundle compiled code in an easy to sell world.

Sure there are commercial encoders that cost money. But considering that
most other languages provide free tools to compile their code and
generate standalone applications that do not depend on commercial
extensions to run, many people just drop PHP as a viable solution to
develop their products.
--

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
Jul 17 '05 #26
Dana Wed, 10 Mar 2004 03:57:49 -0300,
Manuel Lemos <ml****@acm.org> kaze:
Hello,

On 03/10/2004 03:34 AM, Lothar Scholz wrote:
Why not?

You never took a compiler construction course in a university right ?
It makes no sense because the semantik analyse and type interference
are the more important parts. Writing parsers for simple grammers are
done in the second year. And then there is something like register
optimization etc.
Of course it is interesting to do a JIT compiler but nothing for
students course.

I only feel sorry for the poor students who have such teachers.


Maybe, but the world is wide and not every university is equal
everywhere in the world. So, it is possible that for the original poster
university, the teachers could be more open minded and accept different
types of project proposals.


No, he isn't :-) Our compiler has to have lexical analizer, syntax
analizer, semantical analizer, then it has to produce some kind of
middle-source on which the optimization is done and that that optimized
mid-lang goes to assembler (I might have missed something, this week the
teacher started lecturing the syntax analizer, so I'm not sure to which
extent we'll have to go with the later parts). JIT compiler is to simple
to make a project like this. I mean, bytecode don't even have loops, do
they? Syntax tree of a bytecode program wouldn't be a much of a tree
anyway... more something like a bush :-) *IF* I understood the paradigma
of bytecode correctly.

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #27
Nikola Skoric wrote:
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


check this http://www.triplehash.com/content.php?id=26

--
kreso
http://www.plus.hr/cgi-bin/aff/g.o/gdprom
Jul 17 '05 #28


No, he isn't :-) Our compiler has to have lexical analizer, syntax
analizer, semantical analizer, then it has to produce some kind of
middle-source on which the optimization is done and that that optimized
mid-lang goes to assembler (I might have missed something, this week the
teacher started lecturing the syntax analizer, so I'm not sure to which
extent we'll have to go with the later parts). JIT compiler is to simple
to make a project like this. I mean, bytecode don't even have loops, do
they? Syntax tree of a bytecode program wouldn't be a much of a tree
anyway... more something like a bush :-) *IF* I understood the paradigma
of bytecode correctly.


Sorry what??? bytecode is just code ina binary format. ITs interpreted
by a virtual machine to allow cross-platform useage.

Bytecode is effectivly a simple assembler language - one that is as
simple as the most simple device you wish to run on - your compiler
could merge instructions (from the use of otehr markers in the byte
code) into

And bytecode wouldnt have loops??? what about threads?? your entire
stack engine system would have to be worked out (Especially for htings
like networking which you almost certainly want to do in a seperate
thread and call backwards.

Where you seriously going to generate a "linear" program of byte code,
having exploded all the loops & function calls???

just save yourself the time and effort and write a scheme compiler.
Seriously.

J
Jul 17 '05 #29
Mr John Coggeshall is working on one. Check out his project page:
http://www.coggeshall.org/projects.php

Uzytkownik "Nikola Skoric" <ni*******@net4u.hr> napisal w wiadomosci
news:MPG.1ab5b62d9e401c5c989718@localhost...
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!

Jul 17 '05 #30
Nikola Skoric <ni*******@net4u.hr> wrote in message news:<sl**********************@fly.srk.fer.hr>...

Okay i see. You can learn a lot from this course, because your wisdom
about compilers is not very strong at the moment.

Good Luck.
Hope your teacher knows what he/she is doing.
Jul 17 '05 #31
Dana 10 Mar 2004 22:01:54 -0800,
Lothar Scholz <ll*****@web.de> kaze:
Nikola Skoric <ni*******@net4u.hr> wrote in message news:<sl**********************@fly.srk.fer.hr>...

Okay i see. You can learn a lot from this course, because your wisdom
about compilers is not very strong at the moment.


:-) I wouldn't be here if it was :-)

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!
Jul 17 '05 #32
"Chung Leong" <ch***********@hotmail.com> wrote in message news:<QK********************@comcast.com>...
Mr John Coggeshall is working on one. Check out his project page:
http://www.coggeshall.org/projects.php

Uzytkownik "Nikola Skoric" <ni*******@net4u.hr> napisal w wiadomosci
news:MPG.1ab5b62d9e401c5c989718@localhost...
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!


There is this one too

http://www.roadsend.com/home/index.php?pageID=compiler
Jul 17 '05 #33
Ceg
You could run the PHP through some type of PHP2HTML translator then compile
that to compiled HELP.

"Nikola Skoric" <ni*******@net4u.hr> wrote in message
news:MPG.1ab5b62d9e401c5c989718@localhost...
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...

Jul 17 '05 #34
Hello

"Nikola Skoric" <ni*******@net4u.hr> wrote in message
news:MPG.1ab5b62d9e401c5c989718@localhost...
Is the a PHP compiler? A program that compiles PHP code to executable
which doesn't need php interpreter to execute...


There is RoadSend, AFAIK, the only real PHP compiler:

http://www.roadsend.com/

--

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
Jul 17 '05 #35

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff Epler | last post by:
Hello. Recently, Generator Comprehensions were mentioned again on python-list. I have written an implementation for the compiler module. To try it out, however, you must be able to rebuild...
13
by: Bryan Parkoff | last post by:
You may notice that switch (...) is much faster than function that can gain a big improved performance because it only use JMP instruction however function is required to use CALL, PUSH, and POP...
10
by: Bjorn | last post by:
I'm using interfaces in C++ by declaring classes with only pure virtual methods. If then someone wants to implement the interface they needs to inherit from the class. If the implementing class...
7
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
14
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
0
by: rollasoc | last post by:
Hi, I seem to be getting a compiler error Internal Compiler Error (0xc0000005 at address 535DB439): likely culprit is 'BIND'. An internal error has occurred in the compiler. To work around...
3
by: Mark Rockman | last post by:
------ Build started: Project: USDAver2, Configuration: Debug .NET ------ Preparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error...
6
by: toton | last post by:
Hi, Anyone have a link to comparative study of different C++ compilers and how much they conform to C++ language standard? Most of the big platforms I know have GCC which well supports C++...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.