N
N
nolouds2021-03-16 17:51:20
Programming languages
nolouds, 2021-03-16 17:51:20

Can we say that high-level languages ​​encapsulate the code of low-level languages?

Please correct me if I'm wrong somewhere or missed something, but the main question is in the title. For example, CPython is written in C, which means that C code is hidden in it, and those who write in Python do not need to know what is happening there at the C level. In turn, Python itself has functions, such as sorted (), which hides the algorithm sorting. And because of this pyramidal structure, the code of high-level languages ​​is slower. But is it really only a "reference" to a low-level language that causes a slowdown in work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-03-16
@nolouds

No. High-level languages ​​simply move away from low-level constructs.
For example, there is low-level machine code , below which there are only electrical signals.
There is assembler , which abstracts from machine code and already works at the instruction and register level.
There is C , which already works with variables, pointers, and structures.
There is C++ , which already has objects, inheritance, and other OOP.
And there is python , which is simply interpreted.
And it has dynamic typing and a garbage collector.
Well, high-level language != slow.
As an example - Rust, which has very high-level abstractions, but at the same time it is not inferior to C either in speed or in memory consumption.
At the same time, a high-level language is not always built on top of a low-level one - very often a compiler / interpreter is written that immediately leads it to machine code. C libraries also produce machine code as a result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question