[EN | PT ] What is a high and low level language?

avatar
(Edited)

banner

The concept of high-level and low-level programming languages often appears in programming theory books or IT-related blogs. But what is a high-level and low-level programming language?

What is a programming language?

A programming language is a set of methods used to pass instructions to the computer. These instructions first go through a compiler or interpreter that transforms the source code into binary code. But if every programming language does the same thing, why are there so many different languages?

To answer this question, we have to understand that, in programming, there are several ways to do the same thing. To deliver a box to a person, for example, you can deliver the box directly to him, you can send it by post, you can leave it on his desk, among others. Each of these forms has advantages and disadvantages, but they all served their purpose.

The same happens with programming languages, where there are different languages for different needs. Languages are usually divided into high-level languages and low-level languages.

What is the difference between high and low level languages?

This "level" of language is not about better or worse languages, but easier or harder languages for human beings to understand.

High and low level languages compared

High-level languages are languages that resemble human language, being much more readable for human beings. Some examples are Python, Ruby, Perl, PHP and Java.

Low-level languages are typically languages that more closely resemble machine language, such as assembly and C.

One way to see this more clearly is to compare two codes from the famous "Hello World". First in Python:

print('Hello World')

And now in Assembly:

lea si, string
call printf
hlt
string db "Hello World", 0
printf PROC
    mov AL, [SI]
    cmp AL, 0
    je pfend
    mov AH, 0Eh
    int 10h
    inc SI
    jmp printf
    pfend:
    ret
printf ENDP

Let's agree that assembly code looks more Greek than anything else, right? And that's exactly why high-level languages exist: they make the programmer's life easier. Low-level languages are typically faster than high-level languages, precisely because the programmer can pay more attention to specific details of the operating system's architecture.

Which is better: high or low level?

There is no answer to this, higher-level languages are easier to program, while lower-level ones have a number of performance advantages. It all depends on your goals as a developer.

If you want to learn about low-level languages, a good tip is to study C and Assembly. Knowing how to deal with such languages is an extra point on your resume, especially for more advanced positions.

If you prefer the practicality of languages with a more common syntax and with a good performance despite being of a higher level, you will probably prefer something like C++ and Rust.

We also have higher-level languages like Java and C#, both compiled to a bytecode and run by a virtual machine, and PHP, Python, Ruby, JavaScript, and Perl, which are interpreted and higher-level languages than the aforementioned languages .

And so? Did you already know all this? Tell me in the comments ;)


O conceito de linguagens de programação de alto e de baixo nível aparecem geralmente em livros de teoria de programação ou blogs relacionados a TI. Mas o que é uma linguagem de programação de alto e de baixo nível?

O que é uma linguagem de programação?

Uma linguagem de programação é um conjunto de métodos utilizados para passar instruções para o computador. Essas instruções passam antes por um compilador ou um interpretador que transforma o código fonte em código binário. Mas se toda a linguagem de programação faz a mesma coisa, por que existem tantas linguagens diferentes?

Para responder essa pergunta, temos que entender que, em programação, existem diversas maneiras de se fazer a mesma coisa. Para entregar uma caixa para uma pessoa, por exemplo, você pode entregar diretamente a caixa a ela, você pode enviar pelos correios, pode deixar na mesa dela, entre outros. Cada uma dessas formas tem vantagens e desvantagens, mas todas elas atenderam ao seu objetivo.

O mesmo ocorre com linguagens de programação, onde existem diversas linguagens para diversas necessidades. Geralmente se dividem as linguagens em linguagens de alto nível e linguagens de baixo nível.

Qual é a diferença entre linguagens de alto e de baixo nível?

O tal "nível" da linguagem não se trata de linguagens melhores ou piores, mas de linguagens mais fáceis ou mais difíceis para seres humanos compreenderem.

Linguagens de alto e baixo nível em comparação

Linguagens de alto nível são linguagens que se assemelham à linguagem humana, sendo muito mais legíveis para seres humanos. Alguns exemplos são Python, Ruby, Perl, PHP e Java.

Linguagens de baixo nível são tipicamente linguagens que se assemelham mais à linguagem de máquina, como Assembly e C.

Uma forma de ver isso com mais clareza é compararmos dois códigos do famoso "Hello World". Primeiro em Python:

print('Hello World')

E agora em Assembly:

lea si, string
call printf
hlt
string db "Hello World", 0
printf PROC
   mov AL, [SI]
   cmp AL, 0
   je pfend
   mov AH, 0Eh
   int 10h
   inc SI
   jmp printf
   pfend:
   ret
printf ENDP

Vamos concordar que o código em Assembly parece mais grego que qualquer outra coisa, certo? E é exatamente por isso que linguagens de alto nível existem: facilitam a vida do programador. Linguagens de baixo nível são, tipicamente, mais rápidas que linguagens de alto nível, justamente pelo programador poder se atentar mais a detalhes específicos da arquitetura do sistema operacional.

Qual é melhor: alto ou baixo nível?

Não existe resposta para isso, as linguagens de nível mais alto são mais fáceis de se programar, enquanto as de mais baixo nível apresentam uma série de vantagens em relação ao desempenho. Tudo depende de seus objetivos como desenvolvedor.

Se você quer aprender sobre linguagens de baixo nível, uma boa dica é estudar C e Assembly. Saber lidar com tais linguagens é um ponto extra no seu currículo, principalmente para vagas mais avançadas.

Se você prefere a praticidade de linguagens com uma sintaxe mais comum e com um bom desempenho apesar de ser de mais alto nível, provavelmente vai preferir algo como C++ e Rust.

Também temos linguagens de mais alto nível, como Java e C#, ambas compiladas para um bytecode e executadas por uma máquina virtual, e PHP, Python, Ruby, JavaScript e Perl, que são linguagens interpretadas e de mais alto nível que as linguagens anteriormente citadas.

Mas e aí? Já sabia de tudo isso? Conta pra mim nos comentários ;)



0
0
0.000
5 comments
avatar

The people doing V2K with remote neural monitoring want me to believe this lady @battleaxe is an operator. She is involved deeply with her group and @fyrstikken . Her discord is Battleaxe#1003. I cant prove she is the one directly doing the V2K and RNM. Doing it requires more than one person at the least. It cant be done alone. She cant prove she is not one of the ones doing it. I was drugged in my home covertly, it ended badly. They have tried to kill me and are still trying to kill me. I bet nobody does anything at all. Ask @battleaxe to prove it. I bet she wont. They want me to believe the V2K and RNM in me is being broadcast from her location. And what the fuck is "HOMELAND SECURITY" doing about this shit? I think stumbling over their own dicks maybe? Just like they did and are doing with the Havana Syndrome https://ecency.com/fyrstikken/@fairandbalanced/i-am-the-only-motherfucker-on-the-internet-pointing-to-a-direct-source-for-voice-to-skull-electronic-terrorism

0
0
0.000
avatar

You scares me -_-

0
0
0.000
avatar

It should. I left out the scariest things that could happen to you that happened to me. You may scare more as you find out.

0
0
0.000
avatar

The people doing V2K with remote neural monitoring want me to believe this lady @battleaxe is an operator. She is involved deeply with her group and @fyrstikken . Her discord is Battleaxe#1003. I cant prove she is the one directly doing the V2K and RNM. Doing it requires more than one person at the least. It cant be done alone. She cant prove she is not one of the ones doing it. I was drugged in my home covertly, it ended badly. They have tried to kill me and are still trying to kill me. I bet nobody does anything at all. Ask @battleaxe to prove it. I bet she wont. They want me to believe the V2K and RNM in me is being broadcast from her location. And what the fuck is "HOMELAND SECURITY" doing about this shit? I think stumbling over their own dicks maybe? Just like they did and are doing with the Havana Syndrome https://ecency.com/fyrstikken/@fairandbalanced/i-am-the-only-motherfucker-on-the-internet-pointing-to-a-direct-source-for-voice-to-skull-electronic-terrorism

0
0
0.000