views:

422

answers:

7

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?
A: 

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
+28  A: 

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
+1 for a Jedi quote!
Donal Fellows
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ć
@Donal I'll attribute the quote properly when I find the wording :)
Brabster
+1 from me, I think that gives you a "nice answer" which is very well deserved in my opinion. Everything is relative.
Ninefingers
@Ninefingers et al. cheers!
Brabster
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
*relative* is the key word here.
meagar
+5  A: 

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
+1: "I don't know who "everyone" is," Or, as I've heard, "who's 'them'? Name three."
S.Lott
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
Wikipedia article cites no references or sources. It's not complete crap, but it's not good either. -1
Norman Ramsey
+4  A: 

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
+4  A: 

As low-level, I would add:

  • .NET IL
  • Java JVM
  • Other P-Code used in environments like VB6
Cade Roux
They're certainly lower than [C#|VB.Net|whatever], Java or VB6 source code...
Kawa
A: 

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 E
+2  A: 
Norman Ramsey
"Today, C is considered (at least by language professionals) as a low-level language." Can you provide a citation for this?
danben
@danben: Found a couple of citations.
Norman Ramsey