|
Re: The Expressive Power of Languages
|
Posted: Mar 13, 2007 10:42 AM
|
|
From the various replies. I would retain the following:
Expressiveness is directly bound to the level of abstraction you may cover with a given language. Abstraction alone is however not sufficient. You must still be able to control the lowest (i.e. "operational", in the computer sense of the term) level, either directly (machine code) or indirectly (through a reasonnably good compiler).
You have to consider a ladder of abstraction levels, from the lowest (nearest to the machine) to the highest (highly abstract concepts). Your language is expressive if you are able to control the lowest level by expressing things at a higher level. The higher you can express things whilst retaining control on the loweset level, the more expressive your language is.
This is why adding closures to Java makes it more expressive, because it adds a new level of abstraction to the language, whilst still allowing a good control on how things are actually computed.
C allows a very good and wide covering of the low-level concepts (it is broad), but lacks very abstract concepts, so it is not very expressive under this definition.
Philosophical concepts allow you to express very abstract things, but do not give you control on the low-level stuff, so they are not very expressive either.
With the above definition, the most expressive language is UML, because it covers both very abstract concepts, like business rules, use cases, and business processes, yet allows a continuous spectrum down till database tables and small pieces of code. Admittedly the continuum is not very broad and versatile everywhere along the way today (there are some traceability paths between the various abstraction levels that are scarily narrow), but one may hope that the MDA graal will become a palpable reality some day, thus offering a complete (and reasonably large) spectrum.
Another difficulty is that starting from the lowest level (machine code) you have different possibilities to stack up the abstraction layers, thus leading along different paths. Some of these paths correspond roughly to the different programming paradigms we have today, like imperative programming, object-orientation, aspect-oriented programming, prolog-like rule-based programming, etc. All these paths are more or less incompatible with each other, yet they all offer a way to climb up the ladder of abstraction. It is however very difficult, if not even vain, to attempt a comparison to decide which path leads to the highest point of abstraction view.
A vast majority of people probably agree today on saying that object-orientation leads to a higher level than procedural programming alone, but what about functional programming ? which seems like a more natural extension to procedural programming, but without the "burden" of classes.
If you consider the STL (Standard Template Library) of C++, you'll see an extensive use of functor template classes (i.e. closures à la C++), yet not a single polymorphic method. All algorithms are expressed as "pure" template functions (i.e. not encapsulated within a class), which seems quite natural for an algorithm (after all, only a programmer could have the strange idea of putting a free standing function like the computation of an angle's sinus inside a "Math" class!)
Summary: Expressiveness of a given language is directly related to the height of the abstraction ladder it may cover whilst retaining a reasonably good control on the lowest level, but the problem is more about comparing the various possible ladders!
|
|