Previous | Next --- Slide 10 of 66
Back to Lecture Thumbnails
Holladay

Why are these scripting languages so slow?

bpr

@Holladay, all scripting languages are slow. Usually, you don't think about a script being slow as it finishes in less than a second and was easy to develop. Nonetheless, a script interpreter has to do all of the lexing / parsing when the script starts running. It can either then interpret or compile to machine code. Since many of the languages support significant object overloading, the compilation can be limited as so many operations can be redefined and done so by loading another script at runtime.

For some time, scripting runtimes have supported offline compilation, so that if nothing changes, then the script can be quickly executed. The list of languages slowly increases based on the adoption of the language. The runtimes can also maintain a code cache to speed up long running scripts.

Many of these problems also exist for virtual machine languages, such as Java and C#.