Re: [PHP-DEV] NEW PHP standalone compiler (was Re: [PHP-DEV] Herewe try again)

2002-02-01 Thread Stig S. Bakken

On Fri, 2002-02-01 at 08:10, Manuel Lemos wrote:
 Hello,
 
 Stig S. Bakken wrote:
Also, someone may be able to reverse the PHP code to C and create an exe
with it (like Perl) . And last, but maybe the future: Web Services with
SOAP?
  
   It should be not be that hard. There are Java bytecode to C converters,
   it should not be hard to make Zend bytecode to C conversion.
  
  Wishful thinking? :-)
  
  Unless I'm mistaken, Java doesn't have eval.  Any language with eval
  needs a runtime environment when executing, even if the rest of the code
  is converted to C.
 
 I am not expert in Java (actually I don't program in Java - MetaL
 generates it for me if I ever need it), but I suppose that what eval
 does is what java.lang.Compiler class is for.

From what I can see it's related, but I don't think the language design
of Zend/PHP is quite up to C generation, at least not yet.  I would like
nothing more than being proven wrong (by code) though.

 - Stig


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NEW PHP standalone compiler (was Re: [PHP-DEV] Herewe try again)

2002-02-01 Thread Hartmut Holzgraefe

Manuel Lemos wrote:
Unless I'm mistaken, Java doesn't have eval.  Any language with eval
needs a runtime environment when executing, even if the rest of the code
is converted to C
 
 I am not expert in Java (actually I don't program in Java - MetaL
 generates it for me if I ever need it), but I suppose that what eval
 does is what java.lang.Compiler class is for.

java.lang.compiler is a little different ...

1) Java *has* a complete runtime environment available at runtime,
the JVM and the standard classes, that's why JVMs tend to be so
big and have a rather large startup time overhead

2) java.lang.Compiler takes a java source file and compiles it
into a class file, so the result is persistent and you have
to have your code wrapped up to a complete class, write it
to filesystem, compile it, load the compiled class into the JVM
and then execute
eval just executes statements within the eingine, and what
you pass to it has to be just a complete statement, not a
whole class



-- 
Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77

Wir stellen für Sie aus auf der CeBIT 2002 und freuen uns
in Halle 6 auf Ihren Besuch am Stand H 18


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NEW PHP standalone compiler (was Re: [PHP-DEV] Herewe try again)

2002-02-01 Thread Manuel Lemos

Hello,

Hartmut Holzgraefe wrote:
 
 Manuel Lemos wrote:
 Unless I'm mistaken, Java doesn't have eval.  Any language with eval
 needs a runtime environment when executing, even if the rest of the code
 is converted to C
 
  I am not expert in Java (actually I don't program in Java - MetaL
  generates it for me if I ever need it), but I suppose that what eval
  does is what java.lang.Compiler class is for.
 
 java.lang.compiler is a little different ...
 
 1) Java *has* a complete runtime environment available at runtime,
 the JVM and the standard classes, that's why JVMs tend to be so
 big and have a rather large startup time overhead

What is the difference to PHP?

PHP also has to compile any sources before executing them. Actually I
think PHP is much better than Java because the runtime enviroment, which
is Zend compiler and all PHP extensions, was completely handwritten in
C.

 
 2) java.lang.Compiler takes a java source file and compiles it
 into a class file, so the result is persistent and you have
 to have your code wrapped up to a complete class, write it
 to filesystem, compile it, load the compiled class into the JVM
 and then execute

PHP already does that. What is missing is the hooks to save the compiled
output to disk or for instance to somewhere in the network to run in a
distributed enviroment where not only the objects data but also the code
can migrate between machines.


 eval just executes statements within the eingine, and what
 you pass to it has to be just a complete statement, not a
 whole class

Unlike Java, PHP code does not have to be a class. eval is like include
except that the source input comes for a string passed as argument. That
is what is called dynamic loading.

Regards,
Manuel Lemos

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NEW PHP standalone compiler (was Re: [PHP-DEV] Herewe try again)

2002-01-31 Thread Stig S. Bakken

On Thu, 2002-01-31 at 04:06, Manuel Lemos wrote:
 Hello,
 
 Alain Samoun wrote:
  
  Manuel:
  In all fairness to the Zend people, you can get the compiler for $600/year
  or $50 per month.
 
 The unlimited Zend Encoder Unlimited costs $2400. Actually, I don't see
 any other Zend Encoder purchase option.
 
 Anyway, like a lot of other PHP users, I am not interested in expensive
 commercial solutions, even less those that tie me to those products
 indefinetly. If people want to pay such fees to be fair to Zend or just
 to believe that what they got is good because it costed a lot of money,
 fine it is their problem. Now, it is true that a lot of people choose
 PHP because it is a free and easy solution for their developments but
 inlike with other languages there is no way to distribute a closed
 source version of their software.
 
 That is the proposal. This is about PHP, not Zend Encoder or comercial
 solutions. If people wanted to use Zend Encoder or any other commercial
 solutions, this thread would not have been even started.
 
  If it still look too expansive to you, compared to the free perl compiler,
  there is also a perl compiler that costs $5,000...
 
 Alain, be serious, Java compilers cost nothing. I know for a fact that a
 lot of people are discarding PHP because there is not an officially
 supported and free solution to compiler and distribute PHP application
 binaries when in Java and other languages that is a natural thing.
 
 This means that people drop PHP when they realize that it isn't as easy
 to protect their code to sell their applications. Until PHP developers
 realize that it is important to make it easy for PHP users to sell their
 applications, PHP will be seen as a less appealing solution.
 
  Also, someone may be able to reverse the PHP code to C and create an exe
  with it (like Perl) . And last, but maybe the future: Web Services with
  SOAP?
 
 It should be not be that hard. There are Java bytecode to C converters,
 it should not be hard to make Zend bytecode to C conversion.

Wishful thinking? :-)

Unless I'm mistaken, Java doesn't have eval.  Any language with eval
needs a runtime environment when executing, even if the rest of the code
is converted to C.

 - Stig


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NEW PHP standalone compiler (was Re: [PHP-DEV] Herewe try again)

2002-01-31 Thread David Eriksson

On 31 Jan 2002, Stig S. Bakken wrote:

  It should be not be that hard. There are Java bytecode to C converters,
  it should not be hard to make Zend bytecode to C conversion.
 
 Wishful thinking? :-)
 
 Unless I'm mistaken, Java doesn't have eval.  Any language with eval
 needs a runtime environment when executing, even if the rest of the code
 is converted to C.

I can't see any problems living without eval(). But I'm a C++ kind of guy
most of the time... :-)

\David


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NEW PHP standalone compiler (was Re: [PHP-DEV] Herewe try again)

2002-01-31 Thread Manuel Lemos

Hello,

Stig S. Bakken wrote:
   Also, someone may be able to reverse the PHP code to C and create an exe
   with it (like Perl) . And last, but maybe the future: Web Services with
   SOAP?
 
  It should be not be that hard. There are Java bytecode to C converters,
  it should not be hard to make Zend bytecode to C conversion.
 
 Wishful thinking? :-)
 
 Unless I'm mistaken, Java doesn't have eval.  Any language with eval
 needs a runtime environment when executing, even if the rest of the code
 is converted to C.

I am not expert in Java (actually I don't program in Java - MetaL
generates it for me if I ever need it), but I suppose that what eval
does is what java.lang.Compiler class is for.

Regards,
Manuel Lemos

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]