Low, mid, high level language, what's the difference?

后端 未结 12 901
遇见更好的自我
遇见更好的自我 2020-12-22 17:37

I\'ve heard these terms thrown around describing languages before, like C is not quite a low level language, C++ is a mid level, and Python is a High level

相关标签:
12条回答
  • 2020-12-22 18:05

    The term mid-level language is one I've never heard.

    "Low" and "High" refer to how "close" to the machine you are in your programming. The lowest level would be machine (binary) code. Next (and still considered low) is assembler. The higher level languages involve more symbolism and constructs that are supposed to be closer to how humans normally think. C (and somewhat C++) has a reputation as being somewhat a hybrid low/high level because it has many constructs that are in high level languages, but also has instructions (e.g. shifts) that are low level languages but often not in higher level languages.

    0 讨论(0)
  • 2020-12-22 18:07

    In computer science, a low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture. The word "low" refers to the small or nonexistent amount of abstraction between the language and machine language; because of this, low-level languages are sometimes described as being "close to the hardware." A low-level language does not need a compiler or interpreter to run; the processor for which the language was written is able to run the code without using either of these.

    By comparison, a high-level programming language isolates the execution semantics of a computer architecture from the specification of the program, making the process of developing a program simpler and more understandable.

    Middle level languages stand in between the above two

    0 讨论(0)
  • 2020-12-22 18:10

    From low to high, you can categorize the languages as follows.

    Machine Code --> Assembly Language --> Compiled Language --> Interpreted Language

    Remember that these aren't absolute black and white definitions, but rather shades of gray. This is more of a guideline than a rule.

    Think of machine code as a long string of 1s and 0s understood by the native platform. Consider this your baseline... the lowest "level" you can have.

    Assembly language could be considered a symbolic representation of this. I believe there is a 1 to 1 mapping between assembly code instructions and machine code instructions. This is your low level language.

    Java and C++, for example, are both compiled languages, but many would consider C++ to be a lower level language than Java because it exposes low level system access, while Java runs in a protected environment (the virtual machine). Remember that a compiled language is compiled (converted, if you will) to machine code before execution. C is also a compiled language, but would be considered lower level than both Java and C++.

    For our sake, we will say that C and C++ are low level languages because they offer (relatively) little abstraction from the hardware and direct memory management. In actuality, they fall somewhere between low and mid, as you will see soon enough.

    We will call Java and C# (.NET) mid level languages because they have automatic memory management (garbage collection), plenty of high-level abstractions (IE objects... yet C++ supports objects. Do you see why the scale is considered to be loosely defined?)

    With an interpreted language, the interpreter resides in memory and reads the source code directly. These are high level languages. Python, Perl, Javascript, and PHP are all examples of high level languages.

    0 讨论(0)
  • 2020-12-22 18:11

    C is middle level language BECOZ we can use code in assembly language only slight difference pointer make it powerful (if pointer remove in c then it will consider in low level) It's portable feature make middle lavel so we can say it is middle level language.

    0 讨论(0)
  • 2020-12-22 18:15

    low level = long development time + very fast executable file

    high level = shorter development time + slower executable file

    mid level is between the two

    0 讨论(0)
  • 2020-12-22 18:15

    Once you add a spectrum of levels of a programming language you add nuance to the definition. Clearly machine code and assembly are machine-dependent. C and C++ in theory are machine independent but in truth that is not universal. In C things like alignment NEED to be taken into account and you can always manage the stack in C and in the C subset of C++) via a pointer and a single initialised variable - if you are crazy enough - so that (x86) the rsp is never used. So C, yes it is middle level. Everything else is high level some super high level.

    0 讨论(0)
提交回复
热议问题