There are two methods used when translating a programming language into a computer language, the compiler and interpreter method.
Programming language is a language for commanding computers to do something, according to the maker's wishes. Unfortunately, the accepted language is different from the human language. Therefore, programming language commands written by programmers must be translated first, so that the computer can understand them. For example, a programming language such as Java must be compiled first in order to run on a computer, this compilation is called translation. Want to know in detail about the programming language translation method? Ok, I will explain it in more detail and care.
In the programming language, there are two
methods for us to run the code that has been created, this method will
be used to execute the code, for example, we create code to display the
words Hello World, in the PHP programming language we only write the
code echo "Hello World";
then when we open the helloworld.php file,
the words "Hello World" will appear in the browser, which brings up the
interpreter method.
While Java programming is not as simple as PHP when we first create java we need time to initialize the project, after that we can write code scripts, and when we want to run the "Hello World" program we have to change the java file (hello world code) into a new package, this new package that computers and other devices can later read, and this is with the compiler method.
Are you still confused by the explanation of the programming language? Ok, I will explain them one by one.
1. Compiler Method
Compilers are tools for scanning all programming language commands, then converting them into a new package file. This package of files contains machine code that can be read by a computer or other device.
When the user runs the compiled application, the computer can execute commands from the user, such as pressing the save button and so on. The compiled source code will produce .apk extensions for android, .exe for windows, .AAP for iOS and so on.
2. Interpreter Method
Interpreters are tools for converting programming language commands into machine code, without generating new package files. You do this by translating the command line by line when the program is run.
Examples of tools commonly used as interpreters are web browsers. Therefore, Interpreter is often used by specialist website programming languages, such as JavaScript, PHP and Ruby.
Along with the rapid development of technology, many new programming languages have emerged that maximize writing efficiency and speed up application development, whether it be making mobile, websites, or PC applications.
Hopefully, the article about "Programming language translation method so that it can be executed" can be useful, thank you.