Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In general, I have been presented with these sorts of heirarchies for programming language abstraction:

Assembly < C < C++ < Java < Python

where C abstracts less than C++ and so on. You could also consider this on a compiled vs translated vs interpreted language basis (which is usually how this topic is considered, putting C and C++ together), but I'd like to think in terms of levels of abstraction for this question.

Lisp dialects, my favourite language, seem to vary on implementation and fit in between these, along with languages like Haskell and Prolog, but languages like Ruby and Python are undoubtedly at the top.

Are there languages that abstract even more significantly than Python or Ruby? Are these languages desirable to use? Having started with Lisp/C++, I was not expecting to so thoroughly enjoy Python and Ruby. I was also not expecting them to make my coding so much better, since you can use features like Scipy's Weave to use Python to do high level computation for most things and then low level computation for bottleneck code. So I'm wondering if there are even higher level languages available of which I'm unaware and that I should try out.

share|improve this question
1  
I had watched a documentary where a few 3D-goggled programmers were in a room, plucking, stretching, splicing connections in a 3D programming env visible thro their goggles. –  Blessed Geek Jan 1 at 20:15
1  
I wouldn't put Java and C++ so close together in that chain. –  Mathew Foscarini Jan 1 at 20:20
4  
Lisp is a much higher level language than Python. Unlike Python, it's extensible, it can be turned into any language with any semantics, from anywhere on the abstraction level spectre. And even C++ should be higher than Python in this hierarchy, for pretty much the same reason. –  SK-logic Jan 2 at 0:29
 
I present only what I've generally seen in books, having learned better than to claim one language generally more abstract than another. I've also learned my bias towards Lisp (the obvious master language of all time ;) ) has made it a little difficult for me to compare languages. I would agree that Lisp is higher level than Python, though for different reasons. I'm not sure, @SK-logic I understand why you would say that C++ would be higher than Python. Is Python not quite extensible? or is not extensible in a particular way I've not had enough experience to consider? –  Calem Bendell Jan 2 at 2:34
 
@Kylamus, extensibility of any kind is deemed un-pythonic ( see python.org/dev/peps/pep-0020 ). This language is designed to be simple, dumb and fixed, when Lisp and C++ are designed to be as flexible as possible. DSLs in Python is something virtually unheard of. –  SK-logic Jan 2 at 10:31
add comment

closed as primarily opinion-based by gnat, Bart van Ingen Schenau, Simon, Robert Harvey, MichaelT Jan 6 at 16:35

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

5 Answers

up vote 11 down vote accepted

There are several ways of classifying languages, such as execution level, level of abstraction, and generation.

The levels of abstraction classification is like this:

  1. Low-level- these languages have a direct connection with the hardware of the computer. Examples, include Machine Code and Assembly.
  2. High-level- these abstract away the details of the computer. Examples: C (see the comments), Python, Lisp, Ruby, Java.
  3. Very High-level- these are normally domain specific languages, designed for very specific use cases. As a result, they can be more abstract, as the usage case is already known by the compiler. MATLAB might be a good example here.

As for C++, I would say that it's in between Low and High level, but definitely closer to low level.

Another categorization system is the generational classification:

  1. First generation- Machine level language.
  2. Second generation- Assembly language.
  3. Third generation- Refinement of 2nd gen. with more structured programming, making it much more programmer friendly. Examples are: C, BASIC, and Pascal. Another subset of these are OOP languages (Python, Java, C#, C++), which are more abstract than the non-OOP imperative languages.
  4. Fourth generation- These are basically DSLs, with examples including SQL, R, and Mathematica.
  5. Fifth generation- These are where the programmer gives a set of constraints, to solve a problem, rather than creating an algorithm. Examples are Prolog and Mercury.

So, coming back to the question, the languages that are more abstract than Python/Ruby are DSLs and Constraint-based languages.

share|improve this answer
4  
+1 for not following the biased assumption "C++ < Java < Python" of the OP –  Doc Brown Jan 1 at 21:21
8  
Both of your metrics (level and generation) are flawed, and have been misused for marketing so much that they have become practically meaningless. C is not a low-level language by any sane definition, while it is a very low-level high-level language. (C++ can be a suprisingly high-level language if you use modern features). Nevertheless, +1 for well-argued conclusion and sources. –  amon Jan 1 at 21:24
2  
@amon I would say that C is higher level than Assembly or Machine code, but I disagree that it is a high level language. See here for examples of both low and high level C. Now, as you say, languages can be used both at a high level and a low level. These classification systems shouldn't really be categories, but rather a spectrum, and a language can be in multiple places on the spectrum, as it can be used in multiple ways. –  cloudcoder2000 Jan 1 at 21:33
1  
@cloudcoder2000 I think the Relative Meaning section from Wikiepdia sums up my position quite nicely. Also the introduction for low-levels: “In computer science, a low-level [language] provides little or no abstraction from a computer's instruction set architecture.” – C is portable accross architectures. Your link from the comment is interesting but uses Low-level/high-level in a different meaning. –  amon Jan 1 at 21:48
2  
«OOP languages ... which are more abstract than the non-OOP languages» — sorry, what? Would you say that Haskell or Clojure are lower-level than Java because these are not 'OOP languages'? You probably wanted to say that "OOP languages" in your list are higher-level than the previous crop of Algol-descendant imperative languages, like (classic) Pascal. –  9000 Jan 6 at 16:12
show 4 more comments

«A programming language is low level when its programs require attention to the irrelevant.» (A. Perlis)

So the answer very much depends on what kind of abstraction from irrelevant details are you missing in Python that other languages could offer (and thus be 'higher level').

  • You might consider explicit concurrency management irrelevant. Languages like Go or Erlang (and, to some extent, Clojure, Scala, Haskell, C++ with relevant libraries) would help you stop caring about which CPU on which node is running a particular calculation.
  • You might consider order of execution an irrelevant detail. Declarative languages like Prolog or SQL will care about this detail themselves and only need to be told what to do, not how. To some extent, lazy languages like Haskell allow you to describe relationships between data and take care about only computing the minimal amount needed to get the result.
  • You might consider fixed syntax an irrelevant detail. All Lisp descendants (like Clojure or Scheme or Common Lisp) and, to some extent, Ruby let you create syntax that suits your needs. Visual languages like LabView let you shed both the textual syntax and explicit calculation description and build your program as a visual data flow.

As you can see, many of these languages are 'lower level' in other regards: Go has more limitations in describing functions and methods, SQL only works on tabular data, Erlang only gives you immutable data structures, etc. This is because few languages are strictly higher-level than others (e.g. like C++ is higher-level than assembly in every aspect). Most languages are compromises; they let you abstract away one aspect but make you describe another aspect in more detail.

So, again, unless you choose what features you want on a higher level, the question is a bit moot.

share|improve this answer
1  
«A programming language is low level when its programs require attention to the irrelevant.» - by that definition, Java is the lowest-level language there is... –  Idan Arye Jan 6 at 17:53
 
@IdanArye: try to write in C something that does not have to be close to hardware, and you'll notice how Java is sooo much higher-level :) –  9000 Jan 6 at 19:26
add comment

There are plenty of examples in the JavaScript world where you would have to consider them at a higher level of abstraction than Python because they are in fact built upon JavaScript itself directly running in the browser with script interpreting script.

For example: Coffee Script and Processing.js

Coffee Script is at a higher level than Python because JavaScript is interpreting it at runtime. JavaScript is already very abstracted compared with its underlying runtime built from c++. In addition, a further abstraction in terms of syntax is attempted by Coffee Script to shorten and simplify JavaScript to make it less error prone for developers.

Processing.js on the other hand emulates Java and is intended as a generic game/graphics platform for html5. Processing.js is interpreted by JavaScript which may be argued to be less abstract syntactically which puts it in an odd category.

share|improve this answer
add comment

I'd look at language laconic as objective marker of its level height.

As you can see here, from the list of commonly used programming languages, Perl is the only language that can compete with Python and Ruby in laconic.

But as I remember, Prolog programs are even more laconic, though it hardly could be mentioned as a commonly used programming language.

share|improve this answer
add comment

Python is actually less abstract than Java because vital type information is missing. In Python you can not tell from the signature of a method which data structures a function expects or returns. You have to actually look at the source code to determine how to call the method or what it returns. This breaks abstraction. One should be able to call a function without looking inside.

share|improve this answer
1  
You are not actually talking about the same meaning of abstraction. The OP is talking about abstracting machine architecture semantics. You're talking about the OO principle. –  Avner Shahar-Kashtan Jan 2 at 5:43
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.