my dog learned polymorphism*
The moose likes General Computing and the fly likes why scripting languages are slow. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "why scripting languages are slow." Watch "why scripting languages are slow." New topic
Author

why scripting languages are slow.

ramesh maredu
Ranch Hand

Joined: Mar 15, 2008
Posts: 210

I read in an article that
facebook uses hiphop to convert PHP code to C++ code, to gain performance as scripting languages are slow


I searched in web to find out why scripting languages are slow compare to programming languages, I could not get convincing answer, could anyone explain?


SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

A program in a scripting language, by definition, is stored in source-code form until you're ready to run it. When it runs, a program called an interpreter reads the source code and figures out what it means, generating machine code which can then be executed. Usually the translation is done one line at a time, as needed. That translation takes time, and so it slows the program down. For a compiled language, on the other hand, that translation is done by a compiler, once, before you install the program. Then when it is executed, it's already in machine-code form. It's faster because it doesn't have to be translated into machine code before running it.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why scripting languages are slow.
 
Similar Threads
Dynamically Creating JSP
Why Compatibility of java6 with scripting languages
Spring and the forthcoming support for scripting languages
is there any way pass arguments to class method without overloading ?
Java vs. Perl (Speed)