3 ms·
> It is a logical impossibility to make a language more powerful by omitting features, no matter how bad they may be. What does "powerful" mean, in programming
by cabalamat 17y ago
> It is a logical impossibility to make a language more powerful by omitting features, no matter how bad they may be.
What does "powerful" mean, in programming lanugages? I can think of three meanings:
(1) what it can do. Once a language is Turing complete (call this 1.1), in one sense it can do anything. In another sense (1.2), maybe it can't: I wouldn't attept to write a Unix kernel in Java or a 3-D graphics library in Python because in both cases they are too high level of the task.
(2) how easy it is to program in? I.e. the number of programmer-hours it takes to solve a problem in that language.
(3) how easy it is to automatically reason about programs written in the language. This includes tools such as compilers, source code coverage tools, etc.
Now let's examine the original statement by these 4 criteria. We'll also consider the obverse, i.e. whether you can make a language less powerful by adding features.:
1.1 - if a language is already Turing-complete, removing features won't make it more so. Nor will adding features make it less powerful. But Turing-completeness is a trivial sense, as the article points out.
1.2 - adding eatures can make a language less powerful in this sense, because it can reduce the things it can do. For example, a big complex language with a large standard library might not work on a simple embedded controller, so in that sense it could do less. Or a language might require a certain model of multitasking that means it can't run on certain OS's (e.g. Java couldn't run on early versions of Windows (IIRC either 3.1 or 95 -- I don't remember the details). Or consider that Java is "write-once run anywhere"; adding lots of low level features might imperil this.
2 -- adding features can certainly reduce power here too, e.g. if you have a large C++ program written by a team of programmers each of whom uses a different subset of the language.
3. -- again, adding features can reduce power. For example, in Fortran, an optimising compiler can make assumptions about the code that a C++ compiler can't make because C++ allows pointers to point to anything, e.g.:
int foo(int a, int* b){
a = 1;
*b = 2;
bar(a); /* we don't know here if bar is being called
with parameter of 1 or 2 */
}
So I think the original proposition is false in practical terms.