1. Introduction to Programming - Program Translation (iv)

1.4 Program Translation.






1.4.1 Natively compiled languages 

A natively compiled language is a programming language that have compiler(s) built for it which can compile the source code to native code (machine code). Many large softwares with huge code bases ranging from Office suites, IDEs, Compilers, Games, time and mission critical applications were written in compiled languages. You can even observe in your computer many softwares are natively compiled.

A natively language can always be an interpreted language. Take for an instance C++ is a natively compiled language. But it also has a number interpreters like CINT, ch interpreter etc., This is because of the constrains of the native code. The natively compiled languages are created in such a way to suit the constrains but the interpreted languages are not.



1.4.2 Interpreted languages 

In contrast to the above in some languages the source code is executed line by line by a software called interpreter. Interpreted languages are often slow than the compiled languages because of a number of reasons. It is because the source should be executed line by line. Also the interpreted languages like python and even Java, C# have a number of advanced facilities like dynamic typing, type checking, extensive type information which would be stored in the interpreter reduces the performance of the interpreted applications. Another disadvantage is that one should have the interpreter installed in the computer. Some web scripting languages like PHP, JScript and VBScript works based on direct source execution. Some of them may have Just-In-Time compilation but they only don't get their source converted to a bytecode form.


1.4.3 Hybrid approach

There are some compilers or frameworks which convert source code of certain programming languages to an intermediate language that is embedded in an executable or any sort of file. Then the virtual machine or interpreter executes the intermediate language during the runtime of the application. These kinds of applications are rather fast than that have its source interpreted. Sometimes, there is another sort of execution known as Just-In-Time execution(JIT) where the bytecode is converted to native code during runtime by the interpreters and executed. This methodology proved to improve the performance of interpreted languages. Even though then they are slower than natively compiled languages. Microsoft's .NET Framework and some implementations of Java work based on this principle.



Advantages and Disadvantages



Previous
Next Post »