Compiled Languages vs. Scripting Languages

Compiled Languages
Computers do not actually understand the code we write. We need to translate our human-readable code to machine-readable code. Our code need to be translated into bits and bytes that can be executed by computers. This translation process is called compilation. Languages that require compilation are called compiled languages. C, C++ and Java are compiled languages.

Scripting Languages
Languages that not require compilation are called scripting languages. Perl, PHP, Python and Ruby are scripting languages. Those languages rely on our source-code all the time. Scripting languages didn’t have compiler or a compilation process. Those languages used interpreters to translate our source-code to machine executable code on the fly.

Compiled Languages vs. Scripting Languages
Mostly, we have been using compiled languages like C, C++, Java and Visual Basic. Java has an interpreter but it need to compile first. Earlier versions of Visual Basic were interpreted. Visual Basic 5 and later came with compiler. So Java and Visual Basic should be called as compiled languages.

Imagine; you wrote an application with Java. Then you compile your application with javac. After compiling completed, you run your application. When running your application, you notice a bug. To fix it, you have to stop your application, go back to source code, fix the bug, wait for the code to recompile, and restart your application to confirm that it is fixed. And if you find another bug, you’ll need to repeat that process again.

In a scripting language, you can fix the bug and just need to reload your application —no need to restart or recompile anymore. It’s as simple as that.

But, the scripting languages have a big performance problem. Translating on the fly can affect the application’s performance. Typically, the pre-compiled code is faster than on the fly translating. But, good news is, there are ways to speed up scripted languages, including techniques such as code caching and persistent interpreters.

No Comment

No comments yet

Leave a reply