Not all programming is the same: know its different levels

Today there are many programming languages, some easier and more accessible and others more complex. However, machines only understand one language: binary. Programming in binary is something unfeasible and impossible, especially considering the complexity of today’s machines. However, nowadays computing has not evolved so much as to be able to program using natural language; we are at a midpoint, and depending on how close or far we are from machine language we can talk about different levels of programming : high, medium or low.

In the end it does not matter (in quotes) the programming language that we use, since everything has to go through a compiler that generates the binary file, the executable, which is the one that the machine processes. However, depending on the type of programming we use, and the purpose of our project, we may be more interested in using one level of language or another. What is the difference between them?

Low-level programming: talking to the machine

The low – level programming is one whose instructions are very close to the machine language. The programs are designed to work with specific hardware, since the instructions are designed for a specific architecture. If we write a program at a low level, and we take it to a different machine, it will not recognize it as it is not compatible with the instructions.

The main advantage of these programming languages ​​is their performance. As nothing has to be interpreted or compiled, the code is executed as is on the hardware, avoiding intermediaries. But among its drawbacks, in addition to their complexity, we must highlight the incompatibility between platforms, even having to recreate the program from scratch if we want to use it on another machine.

Low-level programming languages ​​interact directly with hardware, without additional compilers or interpreters, allowing us to achieve better performance. This was (for example) the type of programming used on punch cards. The instructions are sent to the equipment directly in binary (first generation), or using a somewhat more familiar language, such as assembler (second generation), made up of abbreviations such as ADD, DIV or SUB. Today this type of programming is only used to maintain the systems of yesteryear, nobody would think of creating a new project in low-level languages.

Mid-level programming: hardware access with “natural” language

The languages midlevel are also very ancient languages, but it was the first born following the evolution of low – level. These languages ​​are somewhere in the middle between low-level and high-level languages ​​because, although they use relatively simple and natural instructions, the programmer has access to the hardware in the same way as low-level languages. In this way, programs can access the system registers and the programmer can work with memory addresses.

Although a much more natural language is used than binary or the assembler itself, by using simple instructions and not requiring complex interpreters, performance similar to that of low-level programs is achieved.

The advantages of languages ​​at this level are that they are much simpler and more natural than machine languages, which makes creating complex programs faster and easier. In addition, since it is not at a very high level, the performance loss is minimal and it has access to the system registers and its resources (through memory pointers). However, it does not allow the creation of dynamic structures or be oriented to objects or events.

C, for example, is the most representative mid-level programming language. Although it is generally considered high-level, it actually has typical characteristics of a low-level language, such as being able to use letters as if they were numbers (it does not distinguish), and the use of pointers, essential for the implementation of hashes and algorithms. Another example of a mid-level language is Basic .

High-level languages: speaking with a certain naturalness

Although programming sounds complicated to many, in reality today it is very simple, and with a few basic notions anyone could create their own program. This is possible thanks to high-level programming languages, languages ​​that use clear instructions using natural language.

The high-level languages ​​are designed to run smoothly on any machine, regardless of the hardware you use. This is possible thanks to compilers and interpreters that are normally included natively in operating systems. It does not matter if a program is programmed in C ++, .NET, Java or Python, if the code has gone through the compiler, and we have the necessary interpreter (such as the Java virtual machine) we can execute them on any operating system, use whatever hardware you use.

These programming languages ​​are designed, above all, to work with dynamic data structures . Low-level and medium-level languages ​​cannot resize structures while they are running, which can lead to excessive resource consumption or sizing problems. Thanks to these dynamic structures, the program can be adjusted to the needs of each system. They are object, event or function oriented languages .

The advantages of this type of language are the creation of a much more natural and understandable code, a program can be used for any machine and any system, it supports programming paradigms and it allows the creation of complex programs with fewer lines. Among its drawbacks, of course, we must highlight a loss of performance of the programs (since they must be interpreted) and that, in some cases, the programs depend on specific platforms.

There are many high-level programming languages. We can find very specific languages ​​(such as Fortran or Cobol ) to perform specific tasks, or generic languages ​​such as C #, C ++ or Visual Basic that are worth a bit of everything.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button