Re: PHP compiler
From: CountScubula (me_at_scantek.hotmail.com)
Date: 03/08/04
- Next message: Tyrone Slothrop: "Re: shopping cart to authorize.net back to the customer"
- Previous message: J Taylor: "Re: PHP compiler"
- In reply to: Nikola Skoric: "Re: PHP compiler"
- Next in thread: Manuel Lemos: "Re: PHP compiler"
- Reply: Manuel Lemos: "Re: PHP compiler"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 08 Mar 2004 20:34:13 GMT
"Nikola Skoric" <nick-news@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
- Next message: Tyrone Slothrop: "Re: shopping cart to authorize.net back to the customer"
- Previous message: J Taylor: "Re: PHP compiler"
- In reply to: Nikola Skoric: "Re: PHP compiler"
- Next in thread: Manuel Lemos: "Re: PHP compiler"
- Reply: Manuel Lemos: "Re: PHP compiler"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|