Reputation: 6221
I've heard these terms thrown around describing languages before, like C is not quite a low-level language, C++ is a midlevel, and Python is a high-level language.
I understand that it has to do something with the way the code is compiled, and how it is written. But what defines a language into one of those three categories? Are these absolute categories, or just a general idea programmers use to describe languages to each other?
Upvotes: 38
Views: 114592
Reputation: 418
High Level Language: Easily readable, focus on productivity, easy to work with and offers abstraction from the details of computer/hardware. e.g. – Every programming language except Assembly language & Machine code)
Low Level Language: Non-readable/understandable, provide more direct control over the system, harder to work with, and offer little or no abstraction from the computer. e.g. – Assembly language, Machine code (lowest level).
Middle Level Language: Consider MLL, as the language which provides a bridge between above two, and often C\C++ tagged as a middle level language it is because they offer features of HLL and LLL.
Upvotes: 1
Reputation: 1
Low-level languages are very close to machine language that may be binary or RTL. It is hard to write and very quick to execute. It can interact with the hardware and a high-level programming language is very easy to write, but it can be executed after compilation.
Upvotes: 0
Reputation: 569
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 register (stack pointer) is never used. So C, yes it is midlevel. Everything else is high-level and some super high-level.
Upvotes: 0
Reputation: 67
It is all relative... The "level" reflect the amount of abstraction.
Upvotes: 0
Reputation: 1
C is a midlevel language, because we can use code in assembly language.
The only slight difference is pointers make it powerful (if pointer remove in C then it be will considered a low-level language). Its portable features makes it midlevel, so we can say it is a midlevel language.
Upvotes: 0
Reputation: 3977
low level = long development time + very fast executable file
high level = shorter development time + slower executable file
mid level is between the two
Upvotes: 24
Reputation: 70869
Yes, they're just general terms. It's to do with abstraction, and how close you are to what the computer's actually doing.
Here's a list of programming languages ranging from very low to very high level:
Machine Code could probably be considered the lowest level programming language.
Assembly language is at the level of telling the processor what to do. There is still a conversion step towards machine code.
C is a step up from assembler, because you get to specify what you want to do in slightly more abstract terms, but you're still fairly close to the metal.
C++ does everything that C can do but adds the capability to abstract things away into classes.
Java/C# do similar things to C++ in a way, but without the opportunity to do everything you can do in C (like pointer manipulation in Java's case [thanks Joe!]). They have garbage collection though, which you have to do manually in C++.
Python/Ruby are even higher level, and let you forget about a lot of the details that you would need to specify in something like Java or C#.
SQL is even higher level (it's declarative). Just say "Give me all the items in the table sorted by age" and it will work out the most efficient way to carry this out for you.
Upvotes: 79
Reputation: 2973
Very low-level: Machine Code
Low level: Assembler, Forth
Mid level: C, C++, most system programming languages
Mid/High level: D, Go, garbage collected system programming languages
High level: Java, C#, most interpreted languages
Even Higher level: Lisp dialects
Highest level: SQL, declarative programming languages
If there is anything else to be added, tell me.
Upvotes: 15
Reputation: 1740
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.
Upvotes: 2
Reputation: 18590
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.
Upvotes: 2
Reputation: 83143
Low level means closer to the machine, and therefore more difficult and more powerful. The higher level you get, the more removed from the machine and "English-like" you get, but you lose a lot of the power and functionality that comes with being able to control the minute details of the machine. Higher level languages also generally tend to protect you more and have much more precautions and checks in place, while lower level languages trust you, so to speak, and let you play around at your own risk.
Upvotes: 2
Reputation: 9245
They aren't absolute. They are all relative to what other languages are being used in industry at the time. For example, there was a time when assembly was considered mid-level.
The 'level' is essentially a measure of how abstracted the programmer is from the actual hardware-based operations. In a low level language you might have to care about actual memory locations, whereas in a high-level you just create variables and let the OS handle memory.
A normal CPU processes either 32 or 64-bit instructions. In the simplest form, think of this as an 32 1's and 0's in a row - that's what the processor actually interprets and executes. Writing this directly (machine code) would be the 'lowest-level'.
Upvotes: 5