Something about programming

Compilers, interpreters and IDE

In this tutorial we will learn how source code transforms into working software.

Source code

Initially any program in any language is just a plain text. This text is called source code. Source code also can be called listing of the program.

To write source code you can use any text editor, even Windows notepad. But usually source code is written in more complex text editors. Such editors have additional features: "highlight" the code, prompt the syntax, check the errors...

To transform source code into working program it must be translated by compiler or interpreter to the language of the processor. Using the compiler or the interpreter depends on the programming language that you choose. There are compiled and interpreted programming languages. Firstly let's see how compilers work.

Compilers

Compiler takes source code and builds it to the binary (executable) file. After that we can run this file but only on the operating system for which it was compiled. You don't need compiler to run the file. You need to pass 1the compiled file to the end user and he can run it without additional software.

Examples of compiled languages: C/C++, Java, Visual basic, Fortran and others.

If program consists of several files with source code, then, you need linker. Linker links (make binds) files between each other.

There could be many compilers for one programming language. For C/C++ there are dozens of compilers from different companies and for different operating systems.

Interpreters

Interpreter translates source code to processor instructions each time you run the program. Interpreter must be installed to run the program. When user wants to execute the program he passes source code to interpreter. You need to pass source code and interpreter to the end user.

Interpreted languages: PHP, JavaScript, Python and others.

Compiler and interpreter have only one but very important difference. Compiler translates the program only one time. It outputs ready to run binary file which can be executed by the end user. Interpreter translates the code each time when the program is executed.

IDE - Integrated Development Environment

So, to create the program you need two different programs:
1. Text editor to write the source code.
2. Compiler or interpreter.

To simplify the process of creating the software some companies release integrated development environments (IDE) for different languages.

IDE contains all tools needed for creating programs. Word integrated means that one program (development environment) contains several programs. Usually IDE has text editor, compiler/interpreter, debugger for error handling, project management tools, version control...

Many IDEs allow development of software on different languages. Visual Studio - C++, Visual Basic, C#; NetBeans - PHP, C++; Eclipse - Java; PyDev - Python.

Comments:

No comments yet