21

In informatics theory I hear and read about high-level and low-level languages all time.

Yet I don't understand why this is still relevant as there aren't any (relevant) low-level languages except assembler in use today.

So you get:

Low-level

  • Assembler

Definitely not low-level

  • C
  • BASIC
  • FORTRAN
  • COBOL
  • ...

High-level

  • C++
  • Ruby
  • Python
  • PHP
  • ...

And if assembler is low-level, how could you put for example C into the same list. I mean: C is extremely high-level compared to assembler. Same even for COBOL, Fortran, etc.

  • So why does everybody keep mentioning high and low-level languages if assembler is really the only low-level language?
Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
hilo
  • 229
  • 1
  • 2
  • 5
  • Those you listed under `Definitely not low-level` are called `middle level languages`. And `binary` is one level lower than `asm` ;) And it is very interesting to see that question about half-dozen language is language-agnostic. – Pratik Deoghare Apr 12 '10 at 19:30
  • 18
    Binary isn't a programming language ;) – hilo Apr 12 '10 at 19:31
  • 7
    Talk to some of the earliest programmers, who entered their code by setting toggle switches on the front panel of the computer. I'm sure they'll be happy to tell you all about programming in binary in the days before assemblers were invented. – Dave Sherohman Apr 12 '10 at 19:36
  • 2
    why isn't binary a programming language? – David Fox Apr 12 '10 at 19:37
  • 6
    @TheMachineCharmer: Technically speaking, he is correct. Binary is a numerical system. Machine code is a language. – danben Apr 12 '10 at 19:37
  • 3
    Binary == Assembler. Having keyed in programs on the front panel, there is NO useful distinction between raw binary and assembler version of raw binary. – S.Lott Apr 12 '10 at 19:38
  • Front panel!? Oh we used to dream of coding the front panel! ;) – Mladen Jablanović Apr 12 '10 at 19:44
  • 3
    C++ is more like "all levels available" -- at your own level-specific risk :) – Klaim Apr 12 '10 at 19:45
  • Does anyone of any importance refer to "middle level languages"? I've seen no such references. – jemfinch Apr 12 '10 at 19:53
  • Again,IMHO Everything you can program in is programming language. If binary is not programming language then nothing is. http://en.wikipedia.org/wiki/Turing_machine_examples – Pratik Deoghare Apr 12 '10 at 20:04
  • 1
    @TheMachineCharmer - I think you need to understand the distinction between a language, a word, and an alphabet. Zwskx is a word over the English alphabet, but it is not a word in the English language. – danben Apr 13 '10 at 04:04
  • @danben: Machine Code == Assembler, colloquially called "Binary". It's all one. It's okay to allow folks to say "Binary" when they mean "Machine Code". They really are all the same language in two forms -- raw and less raw. And, they're the examples of "low-level", along with variants like "PL/M", and "PL/S". – S.Lott Apr 13 '10 at 10:06

8 Answers8

59

You will find that

many of the truths we cling to depend upon our own point of view.

For a C programmer, Assembler is a low-level language. For a Java programmer, C is a low-level language and so on.

I suspect the folks programming the first stored-program computer with 1s and 0s would have thought Assembler a high-level language. It's all relative.

(Quote from Return of the Jedi)

brabster
  • 42,504
  • 27
  • 146
  • 186
  • 2
    There is probably bunch of languages whose programmers would consider Java low-level, and so on... ;) And who knows what the guys coding CPU microcodes (if such thing still exists) think of assembler... – Mladen Jablanović Apr 12 '10 at 19:38
  • @Donal I'll attribute the quote properly when I find the wording :) – brabster Apr 12 '10 at 19:39
  • +1 from me, I think that gives you a "nice answer" which is very well deserved in my opinion. Everything is relative. –  Apr 12 '10 at 19:47
  • At the risk of being unpopular, I am going to say that high-level versus low-level becomes subjective only when you change the definitions of the terms. – danben Apr 12 '10 at 21:28
  • *relative* is the key word here. – user229044 Apr 12 '10 at 21:36
  • [The Store of Mel](http://www.catb.org/jargon/html/story-of-mel.html) is a very interesting account of an old-school programmer who coded in raw machine code, and a new programmer who was porting that hand-written machine code to assembly language to modify a program. (Interesting ethical issue, too; great story). – Peter Cordes Feb 01 '18 at 21:09
9

According to Wikipedia, the low level languages are machine code and assembly.

From the source:

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."

Then, to answer:

So why does everybody keep mentioning high and low-level languages if assembler is really the only low-level language.

I don't know who "everyone" is, but I would venture a guess that back when high-level languages were not as commonplace as they are today, it was more relevant to talk about low-level vs. high-level (because there was a relatively significant amount of programmers writing assembly code). In modern times it is a less important distinction. Personally, I rarely hear people using these terms except to differentiate between assembly or not (except for those times when you might hear someone raised on Python referring to C or C++ as low-level, but this is not in the spirit of the original definition).

danben
  • 80,905
  • 18
  • 123
  • 145
  • Several of my professors in college (from which I just graduated less than a year ago) went on about "high level" versus "low level" languages. I have to say that I didn't give much thought to just how few "low level" languages were out there in the wild today. – Austin Fitzpatrick Apr 12 '10 at 19:55
  • Wikipedia article cites no references or sources. It's not complete crap, but it's not good either. -1 – Norman Ramsey Apr 13 '10 at 00:00
  • I think Brabster should get the tick. The wikipedia answer is crap (though not completely, as Norman said). – John Smith Nov 20 '10 at 18:05
  • "but this is not in the spirit of the original definition" - then the definition needs an update because it is also teribly wrong to put C and Python in the same cathegory. Make this statement in a question here on SO and lets see how fast you get 50 downvotes :) – Gabriel Feb 21 '20 at 09:04
9

You're asking a relatively subjective question; it's a question about terminology, that vernacular, and perspective.

For example, is Lisp a high-level or a low-level language? What if the implementation is running on a Lisp Machine?

Often, when people attempt to build a spectrum from low-level to high-level, what they are trying to quantify is a degree of "closeness to the hardware" as opposed to the degree of "abstraction."

Qualities which count toward an implementation's closeness to the hardware:

  • The programmer directly controls the memory layout of data and has access at run-time to memory addresses of data.
  • Mathematical operations are defined in terms of the hardware or loosely defined in order to conform to different types of hardware.
  • There may be a library providing dynamic memory allocation, but use of dynamic memory is manual.
  • Management of memory during string manipulation is manual.

Converse qualities which count toward an implementation's abstraction from the hardware:

  • The programmer does not have run-time access to address of data (references instead of pointers).
  • Mathematical operations are defined in specific terms not tied to specific hardware. (e.g., ActionScript 3 supports the Number type which self-converts from integer to floating-point rather than experience overflow.)
  • Management of dynamic memory is handled by the environment, possibly through reference counting, garbage collection, or another automated memory management scheme.
  • Management of memory during string manipulation is always hidden from the programmer and handled by the environment.

Other qualities might render a language very abstract compared to the hardware on which it runs:

  • Declarative, search-based syntax. (e.g. Prolog)

With factors like these in mind, I would revise the spectrum you have written as follows:

Lowest level:

  • Assembly language of the platform in question.

Low-level languages with higher-level flow control than assembly:

  • C, C++
  • Pascal

High-level languages:

  • FORTRAN
  • COBOL
  • Python
  • Perl

Highest-level languages:

  • PROLOG
  • Python
  • Scheme

Python appears twice by intent -- it spans a portion of the spectrum depending on how the code is written.

Heath Hunnicutt
  • 18,667
  • 3
  • 39
  • 62
5

As low-level, I would add:

  • .NET IL
  • Java JVM
  • Other P-Code used in environments like VB6
Cade Roux
  • 88,164
  • 40
  • 182
  • 265
4

The "level" of a language is a moving target. In 1973, PL/I was considered a high-level language. Today, C is considered (at least by language professionals) as a low-level language [see footnote]. Some of the reasons:

  • Exposes machine-level representations of numbers
  • "Integer" arithmetic can overflow
  • No real support for strings, or at the very least, strings are not first-class
  • Manual memory management
  • Address arithmetic
  • Unsafe

A high-level language might include

  • Support for integer types independent of the target machine
  • Default integer arithmetic never overflows unless the machine runs out of memory
  • Strings as first-class values with, e.g., concatenation built in
  • Automatic memory management with no address arithmetic
  • Safe

Some candidates as "high-level languages" by this definition might include Icon, Scheme, Smalltalk, and some of your favorite scripting languages.

Back in the day when I was a young scholar and dinosaurs roamed the earth, people referred to Icon as a "very high-level language". As recently as 15 years ago you could even attend a learned symposium on Very High Level Languages. But that term isn't used much any more.

Why does everybody keep mentioning high and low-level languages?

Even though the difference between "high" and "low" keeps changing, distinctions like the ones listed above are still important. And there are so many distinction that the words "high" and "low" can be a useful shorthand. But not that useful—to a cynic, a high-level language is one that looks at least as powerful as whatever my favorite language is, and a low-level language is everything else. In other words, "level" can easily degenerate into mere name-calling.

Footnote: It's hard to find citations for terminology used at professional meetings, especially when professionals don't use the terms "low-level" and "high-level" because they're not so technical. But danben asked about citations, and I found a couple:


P.S. Don't count too heavily on Wikipedia for good information on programming languages, especially if the Wikipedia reference cites no references or sources

Koedlt
  • 4,286
  • 8
  • 15
  • 33
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
0

Purely guessing here, but this may be a case of language-shift, whereby the distinction between low- and high-level langauges is slowly evolving in peoples' minds into the difference between managed- and unmanaged-languages, typed-and untyped-languages etc.etc. (at least in the way people are using the terminology).

davek
  • 22,499
  • 9
  • 75
  • 95
0

To a large extent, "low-level" and "high-level" not binary categories but are a continuum. There are some languages that are clearly low-level (assembly, machine code), but beyond that there is really only "higher-level" and "lower-level".

As I see it, "lower-level" languages require code that looks more like the architecture of the computer, and "higher-level" languages accept code that looks more like the structure of the problem. But with that, languages can be high-level for one problem and low-level for another.

Michael Ekstrand
  • 28,379
  • 9
  • 61
  • 93
0

Low-level Binary Assembler

ET IL Java JVM Other P-Code used in environments like VB6

Definitely not low-level

C BASIC FORTRAN COBOL Python Perl Pascal

High-level C++ Ruby Python PHP PROLOG Scheme