Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Converting PHP codes into highly optimized c++ codes

  1. #11
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    IIUC, Java is compiled into a specialized form of bytecode (not to machine language, for example, as c is), and is then interpreted at runtime by the JVM. I don't know too much about it, though.

  2. #12
    Join Date
    Jul 2012
    Posts
    198
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default

    Yes, then JVM will interpret the code into machine language..

    Then why it says Java is faster than Php ,

    PHP is only interpreting the human language(code) into machine codes and execute the program (1 step process)

    Java is first compiling pgrm codes into byte code and then interpreted by JVM at run time (2 step process),
    even if compilation is done only once, then interpretation retains, then the statement JAVA FASTER is false ?

    Other wise i think interpreting byte codes is faster than interpreting human language codes directly,
    Last edited by letom; 12-03-2013 at 06:14 AM.
    You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God

  3. #13
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    It doesn't matter how many steps there are. What matters is how fast the code runs.
    C++ runs faster than PHP because PHP is inefficient in design, mostly because it isn't compiled into machine code.
    So for Java the question is how fast compiled Java runs, not how quickly it is converted/compiled.
    Last edited by djr33; 12-05-2013 at 12:50 AM. Reason: typo
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #14
    Join Date
    Jul 2012
    Posts
    198
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default

    Thanks.. Hope future versions of php will solve these issues and additionally make it fully completable to develop client side applications
    You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God

  5. #15
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hope future versions of php will solve these issues
    That's not really possible. The goals of PHP are not to make it the fastest language. The goal is to make it easy to use on webservers. Therefore, it is not the best language to run extremely complicated or processor-intensive code. But usually websites don't require that. That's best in C++ or Java, when you are creating an application to run natively on the computer.

    and additionally make it fully completable to develop client side applications
    This is not what PHP is designed to do. Just like cars are not designed to fly in the air or float in water, PHP is not designed to work client-side. There are many reasons: 1) it is secure on the server, and would not be secure client-side (like JS is not secure); 2) it is meant to work on a server with databases and other server-side things; and 3) it is designed as a "hypertext pre-processor"-- it is designed to generate webpages (HTML output), not to interact with a user.

    However, in the future technologies like AJAX (or perhaps node.js) will be improved and extended so that interaction between client-side scripting (like JS) and server-side programming (like PHP) is made much smoother. Really, this is the whole idea of (or at least one major aspect of) "Web 2.0".

    But PHP will never be a client-side technology. Or at least it will not be client-side without such major changes that it would no longer really be PHP any more. Maybe it would have the same name, but that would probably be more confusing than helpful.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Similar Threads

  1. Replies: 1
    Last Post: 05-10-2010, 03:18 PM
  2. help with the codes!
    By makarov in forum Java
    Replies: 1
    Last Post: 11-15-2009, 09:36 PM
  3. BB codes
    By vaibhav24in in forum PHP
    Replies: 5
    Last Post: 03-13-2007, 07:27 AM
  4. Need help with these codes please!
    By Quanlin127 in forum HTML
    Replies: 5
    Last Post: 01-25-2006, 07:12 AM
  5. Codes
    By Charmed in forum HTML
    Replies: 2
    Last Post: 05-25-2005, 11:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •