Summary
Here is a challenge, try to define what a programming language is.
Advertisement
Here are some definitions of "programming language" which I have found around the internet:
An artificial language used to write instructions that can be translated into machine language and then executed by a computer. - "programming language." The American Heritage® Dictionary of the English Language, Fourth Edition. Houghton Mifflin Company, 2004. Answers.com 14 Jul. 2006. http://www.answers.com/topic/programming-language
syntax, grammar, and symbols or words used to give instructions to a computer. - programming language." The Columbia Electronic Encyclopedia, Sixth Edition. Columbia University Press., 2003. Answers.com 14 Jul. 2006. http://www.answers.com/topic/programming-language
A programming language is an artificial language that can be used to control the behavior of a machine (often a computer). - "programming language." Wikipedia. Wikipedia, 2005. Answers.com 14 Jul. 2006. http://www.answers.com/topic/programming-language
These definitions are insufficient because a programming language doesn't neccessarily require translation, or execution by a computer. These definitions reflects the more mechanical view of programming languages, as a means of communicating a series of instructions to a machine.
Another view of a programming language, which would appeal to the more academically minded, is that a programming language is a language for expressing computations. This also would be insufficient by itself, because it ignores the fact that much of programming is telling a computer what to do. (e.g. tell the OS to move a file, send a digital signal down a cable, store bits in memory, etc.).
Here is my ambitious attempt at a definition:
Programming Language - A language which: expresses instructions governing the behavior of software, or a machine; or which expresses a computation
What this highlights for me is a fundamental problem of theoretical computer science: bridging the gap between computing something, and doing something. This is an important and often overlooked problem.
How would you define what a programming language is?
> <li>expresses instructions governing the behavior of > software, or a machine</li>
Did you already establish that it doesn't have to be executed by a machine?
> and / or > > <li>expresses a computation</li>
I'm not totally clear to me that expressing calculations makes something a programming language. That would make arithmetic a programming language, right? Wouldn't 'expresses an algorithm' be more accurate?
> A language which allows us to express computation > unabiguously.
Do you have to express computations with a machine? I could design a programmign language which simply controls a robot. Where would the computation be in that case?
> > <li>expresses instructions governing the behavior of > > software, or a machine</li> > > Did you already establish that it doesn't have to be > executed by a machine?
That is where the "or" clause below comes in to play.
> > and / or > > > > <li>expresses a computation</li> > > I'm not totally clear to me that expressing calculations > makes something a programming language. That would make > arithmetic a programming language, right? Wouldn't > 'expresses an algorithm' be more accurate?
I believe a computation implies both calculations and algorithms.
Fundamentally a programming language is tool for the specification of software. Hopefully the specification captures the design intent of the programmer. It is meant to be processed by a machine. There are various styles of specification including declarative and imperative both of which are equally programming language styles in their own right.
To really define programming language, I think we need to define language in this context. For me, a language is the composition of abstract syntax, concrete syntax and semantics. Got to have all three for it to be a practical language. Any weakness in any of these renders a language to an intellectual exercise rather than a practical tool
A program is fundamentally an abstraction packaging mechanism that models some lower level more detailed artifacts or processes many of which we would rather ignore as they are cluttering the problem at hand and getting in the way of expressing our design intent.
> Another view of a programming language, which would appeal > to the more academically minded, is that a programming > language is a language for expressing computations. This > also would be insufficient by itself, because it ignores > the fact that much of programming is telling a computer > what to do. (e.g. tell the OS to move a file, send a > digital signal down a cable, store bits in memory, etc.). > > <p/> > Here is my ambitious attempt at a definition: > > <blockquote> > <b>Programming Language</b> - A language which: expresses > instructions governing the behavior of software, or a > machine; or which expresses a computation > </blockquote> > > What this highlights for me is a fundamental problem of > theoretical computer science: bridging the gap between > computing something, and doing something. This is an > important and often overlooked problem. > <p> > How would you define what a programming language is?
A programming language is computations. Doing something is not different than computations, assuming that the function takes the World as an input and returns a World as an output.
Doing something (for example, copying a file, or instructing a robot to move) that has side effects is a monadic fold over the data. Well, it looks like a monadic fold to us, but some scientists have theorized that for every change in the universe, the universe is duplicated, and thus we can have time travel.
In other words, some scientists say that the universe works like a pure functional programming language: each change in the universe creates a new copy of it, that's why we have parallel universes.
> > > <li>expresses instructions governing the behavior of > > > software, or a machine</li> > > > > Did you already establish that it doesn't have to be > > executed by a machine? > > That is where the "or" clause below comes in to play.
But your or states that only computations don't have to be executed on a machine. Can't a instructions governing behavior also be executed without a machine?
> > > and / or > > > > > > <li>expresses a computation</li> > > > > I'm not totally clear to me that expressing > calculations > > makes something a programming language. That would > make > > arithmetic a programming language, right? Wouldn't > > 'expresses an algorithm' be more accurate? > > I believe a computation implies both calculations and > algorithms.
Aren't both just a way of specifying instructions? It seems like an uneccesary distintion.
> Do you have to express computations with a machine? I > could design a programmign language which simply controls > a robot. Where would the computation be in that case?
Haven't you read "Society of Mind?" by Minsky. Algorithms, grammars, semantics, computation, processing; is all an illusion. Or is it?
How smart if flipping a bit or popping your stack?
I can't make much of this question. What do we need that definition for? I never felt the urge to define what a "programming language" is. However I've had a look at your attempts.
"a language for expressing computations" Well, isn't English a language in which computations can be expressed? "Multiply three with sixteen and then take the square root", that sounds like expressing a computation to me. So has anybody heer come up with a definition that would distinguish programming languages from natural languages?