The most important thing in running a computer is the program. In programming, several programming languages are known, just as humans know the languages used to communicate. Humans communicate using words or characters while computers use codes 0 and 1.
Programming Language Levels
Therefore, experts and scientists created a programming language that aims to make it easier for humans to communicate with computers. With this programming language, if humans want to communicate with computers, they do not have to translate into 0 and 1. If that is done, how complicated a program is.
Substance:
- BASIC TERMS IN PROGRAMMING
- CLASSIFICATION OF PROGRAMMING LANGUAGES
- INTERPRETER
- COMPILER
- DIFFERENCE BETWEEN INTERPRETER AND COMPILER
1. Basic Terms in Programming
A program is a word, expression, statement or combination that is arranged and assembled into a single procedure that becomes a sequence of steps to adjust the problem implemented with a programming language.
Programming language, is a procedure or method of writing a program in a programming language, there are two important factors, namely syntax and semantics. Syntax is the grammatical rules that govern the procedure for writing words, expressions and statements while Semantics are the rules for expressing a meaning. Example: Write, Read, etc.
Programming is the process of implementing a sequence of steps to solve a problem using a programming language.
Structured Programming is the process of implementing a sequence of steps to solve a problem in the form of a program that has a structured and uncomplicated design so that it is easy to trace, understand and develop by anyone.
2. Classification of Programming Languages
In general, programming languages are divided into four groups:
- Low Level Language, Is a machine-oriented language. Programmers with this language must think based on machine logic, so this language is less flexible and difficult to understand. Example: Machine language, Assembly language.
- Middle Level Language, is a programming language that uses grammatical rules in writing expressions or statements with standards that are easy for humans to understand and has certain instructions that can be directly accessed by computers. Examples: C, B, Fortran.
- High Level Language, is a programming language that uses grammatical rules in writing expressions or statements with language standards that can be directly understood by humans. Examples: Pascal, Basic, COBOL.
- Object Oriented Programming (OOP), is a collaboration between GUI and object oriented programming language, so we do not need to write in detail all statements and expressions like high-level languages, but only by entering the desired criteria. Examples: Delphi, Visual Basic, C++.
In order for a computer to understand a program written in a programming language, a translator is needed, namely an Interpreter and Compiler.
3. Interpreter
Interpreter comes from the word to interpret which means to translate or interpret. Interpreter is a programming language translator that translates instructions one by one during program execution.
When translating, the interpreter will check the syntax (program syntax), semantics (command meaning), and logical correctness. If a syntax error is found, the interpreter will display an error message and program execution will stop immediately.
Interpreter Work Process
4. Compiler
Derived from the word to compile which means to compile, collect or assemble. Compiler is a compiler/collector of instructions in a single module unit that has successfully passed the interpreter stage so that it becomes a machine language (program object), then the program object will experience linking which functions to combine the modules with other related modules such as data on machine characteristics, library files or other program objects related to other objects to produce an Executable program file that will be executed by the computer.
Compiler working process
5. Difference between Interpreter & Compiler
| No. | Intepreter | Compiler |
|-------|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| 1. | Menerjemahkan instruksi per instruksi | Sekaligus menerjemahkan secara keseluruhan |
| 2. | Bila terjadi kesalahan kompilasi, dapat langsung dibetulakn secara interaktif | Bila terjadi kesalahan kompilasi, Source program harus dibenarkan dan proses kompilasi diulang kembali. |
| 3. | Tidak menghasilkan objek program | Menghasilkan objek program |
| 4. | Tidak menghasilkan executable program karena langsung dijalankan pada saaat program diinterprestasi | Menghasilkan executable program, sehingga dapat dijalankan dalam kedaan prompt system |
| 5. | Proses interprestasi terasa cepat, karena tiap-tiap output langsung dilihat hasilnya | Proses kompilasi lama, karena sekaligus menerjemahkan seluruh instruksi program |
| 6. | Source program terus dipergunakan karena tidak dihasilkan executable program | Source program sudah tidak dipergunakan lagi untuk mengerjakan program |
| 7. | Proses pengerjaan program lebih lambat karena setiap instruksi dikerjakan harus diinterprestasikan ulang. | Proses mengerjakan program lebih cepat, karena executable program sudah dalam bahasa mesin |
| 8. | Keamanan dari program kurang terjamin, karena yang selalu digunakan adalah source program | Keamanan dari program lebih terjamin, karena yang dipergunakan executable program |
Source:
© STMIK El Rahma Yogyakarta. Compiled by Mr. Eko Riswanto, ST, M.Cs.
Netizens
Q1:
- JEFRY DEWANGGA Apr 13, 2015, 08:35:00 = I prefer to learn web programming, even though I still don't master it. ^_^ Hehehe if I'm not mistaken the iOS 8 application also uses HTML5..
- DODI SETYAWAN 25 Jul 2015, 07:21:00 = Wow, I still don't really understand the difference between INTERPRETER AND COMPILER, bro. It would be good to include examples of both, from source to output.
A1:
- Good, bro. Indeed, bro, programming languages are like a menu, so every programmer also has their own taste or in other words, programmers have their own specializations, including you. Good, bro. Keep improving and building this country with your skills. Good luck and thank you.
- Hello DODI SETYAWAN, so this is how Interpreter and Compiler are not simple source codes like the codes that I have shared here, so Interpreter and Compiler are complete programs with complex structures, consisting of several interrelated program modules such as *.lib *.obj *.lib *.dll *.exe and others. if you still don't have an idea about both, please just imagine the structure of the Pro Evolution Soccer program, in its directories/folders there are libraries for sound, music, images, and others. So, that's the picture of Interpreter and Compiler, running in the background, each designed to handle specific tasks, such as translating high-level programming languages to low-level (assembly) that can be understood by hardware (IC families, etc.). So, Mr. DODI SETYAWAN's questions about source code and its output, can be saved for now, one day, when Mr. DODI SETYAWAN has taken the COMPILER course and has mastered it, I'm sure Mr. DODI won't be able to answer it either, because the question is more appropriately aimed at the basics of programming languages.