• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

why scripting languages are slow.

 
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
They weren't very bright, but they were very, very big. Ad contrast:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic