Talk:Programming language

This is an old revision of this page, as edited by Allan McInnes (talk | contribs) at 20:44, 19 June 2006 (HTML as programming language: cite). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 18 years ago by Allan McInnes in topic HTML as programming language

{{FAC}} should be substituted at the top of the article talk page Template:Current-CS-COTW

Archives

Newish discussion

Lead paragraph trying again

Okay I've slept on the matter. Let me try to summarize my position.

It really would be best to provide a simple citation, as I have done. All the evidence presented so far is indirect. Nevertheless, I expect to be shouted down on this point, so I will yield.

The next question is how to write the lead paragraph to be NPOV between the two positions. This is the question I tried to bring up before that was universally ignored. I hope no one disputes this, as I really can't see how you can possibly argue that the Turing-complete POV should be completely ignored as my POV, having two citations, is by Wikipedia policy in a stronger position than your POV, having none. Ideogram 01:36, 17 June 2006 (UTC)Reply

The Turing bit in "Definitions"

I still think a footnote is better, but I yield to Derek on his preference for inline text.

I suspect that most readers will be surprised by these examples. Also I have seen instances where people have jumped in and edited material without reading the footnotes. An 'idiot proof' article cuts down on the maintenance. Derek farn 02:04, 18 June 2006 (UTC)Reply

However, I want to not that I think something like sed is important to list in the examples.

I think Joe Smoe will have heard of html, might have heard of sql and is very unlikely to have heard of sed (care to bet that an 'expert' windows programmer edits out that entry within 24 hours?). Derek farn 02:04, 18 June 2006 (UTC)Reply
If so, I'll restore it. Readership is mixed; it's general audience sure, but use of *nix systems is not "non-general". I don't want to belabor the issue of the exact computational power of 'sed' (which I believe should be equivalent to a regular grammar; or maybe even more than that), but mentioning something fairly well-known and at a meaningfully "intermediate" level of power is worthwhile. It's only a half-dozen words, if readers want to know more, they can follow the sed link. LotLE×talk 04:12, 18 June 2006 (UTC)Reply
As it turns out, sed is apparently Turing complete. --Allan McInnes (talk) 20:29, 19 June 2006 (UTC)Reply
Oh, that seems right. I had forgotten about the 'b' instruction since... well, when I use sed it's almost always just 's/foo/bar/'. LotLE×talk 20:41, 19 June 2006 (UTC)Reply

In particular, my own use of "programming language" would almost certainly exclude HTML or similar markup-only languages, though I recognize PL is sometimes used by non-experts of HTML. On the other hand, I would myself almost certainly call sed scripts "programming language" (knowing full well their limited computation power).

Which of the definitions of programming language would you apply to sed scripts? Derek farn 02:04, 18 June 2006 (UTC)Reply
Of the bullets, the first three all clearly apply to sed scripts, especially to scripts that are more than one-liners. The last bullet isn't exactly a definition: it says there are these different levels of computational power, and lots of things are Turing-equivalent, but it doesn't realy define the language in terms of computability. LotLE×talk 04:16, 18 June 2006 (UTC)Reply

An important difference is that sed does something. That is, you can run a sed script to perform relatively sophisticated and complicated modifications to files, and in a way you might want to repeat against different input files. In that, it serves a very similar role to Perl, Python, Bash, etc. (Is Bash Turing-complete if you exclude all the standard file/text utilities it typically utilizes? The answer isn't immediately obvious to me, though I would lean toward "yes" in my intuition).

SQL has a little bit of the same quality. It performs meaningful manipulations on a special object, an RDBMS. But something that tweaks texts and files has much more of the "feel" of a regular programming language, quite apart from details of syntax or formal computational power. LotLE×talk 00:45, 18 June 2006 (UTC)Reply

Digression on branching and loops

It's not a terribly important point, but the third bullet in "Definitions" lists flow control as part of the description. On might be inclined to think that sed does not include flow control. However, this is not so. While you cannot loop in sed, you can branch. For example, let's implement this pseudo-code IF block:

FOR LINE in FILE:
  IF contains_digits(LINE):
    use_ampersand(LINE)

Here's my sed version:

$ cat test.data 
Spam and 37 eggs
Spam and twenty-one eggs
$ cat test.sed
s/\(.*\)\([0-9]\)/(HAS NUM)\1\2/
s/^\((HAS NUM)\)\(.*\)\(and\)\(.*\)/\2\&\4/
$ sed -f test.sed test.data 
Spam & 37 eggs
Spam and twenty-one eggs

In particular, I create a placeholder prefix on the line in order to effectively have an "IF" test on the next line of the sed script. More complex arrangements are possible with such placeholders, but this shows the concept.

Also, as written, the article describes the need for a looping construct to be Turing complete. While something like a loop (including recursion, though calling that a loop feels a bit pedantic to me) is necessary, it is not sufficient. You need a specific kind of loop. The example BlooP was constructed specifically to show that a loop can be "too weak" for Turing completeness. This isn't the article to get into a lot of detail on that, but I wonder if maybe a word or two couldn't be changed to be slightly more accurate (what it says isn't false, but it's slightly misleading). LotLE×talk 05:09, 18 June 2006 (UTC)Reply

As I recall the BlooP/FlooP discussion had nothing to do with Turing completness (I cannot recall whether it was about Chomsky's four levels of grammar or first order logic vs. propositional calculus. I will have to go and dig my copy of GEB out from under a big pile of boxes in the garrage. Look at the definition of Turing machine to see that a test and jump loop is all that is needed (plus of course store/recall). Derek farn 20:38, 19 June 2006 (UTC)Reply
BlooP has a loop, but it's something like "Loop no more than N times". N is itself unbounded, but must be specified in the construct. That's enough to make it not-quite-Turing. Obviously, if it had a GOTO, that would also be strong enough, but it doesn't. LotLE×talk 20:44, 19 June 2006 (UTC)Reply

Frankly, the article lacks some critical points

"program" is not defined in the article (A list of instructions performed by a computing machine). "Programming" is not defined in the article (The creation of such a list of instructions). "Language" is defined early but reference to it is preceed by "artificial" which is wholly insubstantial because there is nothing artificial about a list of instructions. A programming language is the most direct and best method of communicating with a machine and the purpose of a language is always communication. "Artifical" should be struck from the first line. "Program" should be placed first in the list of definitions. The article also mispresents, I believe, the commonality of modernly used languages. Its first paragraphs create a confusion of "thousands of languages" with no starting point for a person to begin to understand that a programming language is a method by which a person instructs a machine to perform a series of operations. Terryeo 08:58, 19 June 2006 (UTC)Reply

Spurious "citation needed"

There were {fact} tags recently added to all the bullet points in "Definitions" (in what I certainly hope is not WP:POINT). I'm having a bit of trouble making sense of those tags. I removed the last of these since it seems only to accompany a brief summary of what's in the linked article theory of computation (the latter is, or should be, sufficiently cited).

The first three bullets have their {fact} tags right now. But I can only just barely make sense of what's being requested, and only if I kind of squint my eyes a bit. Most neutral summaries of uniform consensus opinions do not require a specific footnote. And it's hard for me to see where any actual dispute or doubt applies to the bulleted items. By analogy, the first sentence does not read:

A programming language is an artificial language[citation needed] intended to be usable for controlling the behavior of a machine (often a computer[citation needed]). Like human languages, programming languages have syntactic[citation needed] and semantic[citation needed] rules used to define meaning.

...because no one seriously doubts or disagrees that PLs are artificial languages; often used on computers; have a syntax; or have a semantics. Some editors I come across seem to have a confusion between the idea that WP is not original research, and the wrong idea that WP is the same thing as a photocopier.

So what's actually in dispute about the bulleted definitions? LotLE×talk 17:53, 19 June 2006 (UTC)Reply

I'm not disputing them, nor is this a WP:POINT. I think they need citations (see below). Ideogram 19:06, 19 June 2006 (UTC)Reply
So it's just a random sprinkling of "citation needed" tags because you think the total number should be higher?! That's just plain wrong-headed, I'm afraid. And it sure sounds a lot like WP:POINT to me... a better approach would be to actually add a concrete citation where you think it is useful and relevant.
Don't accuse me of WP:POINT, or I will get cranky. I specifically mentioned earlier that I wanted citations for these alternate definitions. Ideogram 19:21, 19 June 2006 (UTC)Reply
FWIW, I do think more footnotes would be desirable. But the last time I tried to add one, Derek farn took it out on the grounds that "readers don't look at footnotes". So I ceded on that, and let the material go in the main text. LotLE×talk 19:15, 19 June 2006 (UTC)Reply
Not footnotes. Citations. References to secondary sources backing up included material. See Wikipedia:Featured article candidates/Forth. Ideogram 19:21, 19 June 2006 (UTC)Reply

Be specific

Leaving aside warring pointillism or crankishness, can you please explain with specificity, Ideogram, what you feel needs citation in the following... and what would constitute relevant citation:

  • The language's users and audience. For example, a programming language differs from natural languages in that natural languages are used for interaction between people, while programming languages allow humans to communicate instructions to machines.[citation needed]
  • The language's constructs. For example, a programming language may contain constructs for defining and manipulating data structures or for controlling the flow of execution.[citation needed]

I'm quite honestly and sincerely at a loss to understand how those differ from the lead sentence reductio ad absurdum I mention. What type of publication might be relevant to supporting such broad and commonplace summaries? Actually, let me back-pedal slightly... I can slightly make sense of how the data-structures/flow-control might be a non-universal characterization. The "interacting with machines" part I can't get at even that level. LotLE×talk 19:44, 19 June 2006 (UTC)Reply

Derek farn claimed that there were different definitions in use. I want to see citations stating those definitions like the citations I provided stating my definition.
But if you don't want to do it, don't let me stand in your way. I've been advised, by the mediator no less, to leave this article entirely and let you guys work it out. No, I'm not bitter. Ideogram 20:22, 19 June 2006 (UTC)Reply

FAC premature

I guarantee this FAC nomination will fail. I recently tried a FAC nomination and was told I need as many as one citation per paragraph. This article is nowhere near that. Ideogram 19:04, 19 June 2006 (UTC)Reply

FAC commentators make lots of different comments, often contradicting each other. I'm not per se disagreeing with the ">1 citation/para" guideline, but someone suggesting that isn't the same as it being an actual WP guideline.
Several commentators noted the need for more citations in my nominee. This article has a similar level of citation. Ideogram 19:17, 19 June 2006 (UTC)Reply
In any case, I imagine we can benefit from whatever FAC commentators suggest. There's nothing particularly wrong with failing a FAC nomination; and it's even a good thing if it generates useful suggestions (there's no restriction on renominating later).
I agree we can benefit from their suggestions, but I could have told you what they would say. Ideogram 19:17, 19 June 2006 (UTC)Reply
Actually, the truth is that I really could hardly care less whether or not this article becomes an Featured Article. Ideogram—and I think a couple other editors—have suggested that would be a desirable thing. So I figured some outside input on where it might fall short of that would be helpful. LotLE×talk 19:12, 19 June 2006 (UTC)Reply
Again, I do feel FA status is desirable, but if you had asked me I would have told you what that requires. Certainly a Peer Review first would have been a good idea. Ideogram 19:17, 19 June 2006 (UTC)Reply
Opinions vary, but I've had a number of editors comment that Peer Review rarely generates as much, or as relevant, commentary as FAC nomination. That's pretty much been my experience as well. LotLE×talk 19:34, 19 June 2006 (UTC)Reply
<Shrug>. It helped me. See Wikipedia:Peer review/Forth.

HTML as programming language

HTML is not a programming language; as its name says, it is a "markup language" designed to indicate the structure of data. Though it isn't really a data structure either, it is reasonable to treat the DOM tree that it describes as a data structure. Javascript operating on HTML to make "dynamic HTML" is not a new programming language; it is the Javascript programming language operating on the DOM data structure. It is like the difference between S-expressions and Lisp programs: (((a . b) c) (x) (23 4.5)) is a Lisp S-expression (a piece of data), while (cond ((atom x) x) (t (cons (cdr x) (car x)))) is a program fragment. In Lisp, of course, the program is expressed using the S-expression data structure. But then, there are *other* programming languages (such as, say, Planner) which use S-expressions as the representation of programs. --Macrakis 20:05, 19 June 2006 (UTC)Reply

While I haven't wanted to rock that particular boat, I second Macrakis' comments and his edit in removing HTML as an example. I wonder though if it might not be possible to add something along the lines of: Non-computational markup languages are sometimes informally referred to as programming languages. I agree the equation is a mistake, but it's one that's made fairly often by laypeople. LotLE×talk 20:12, 19 June 2006 (UTC)Reply
I also agree with Macrakis. PLs are a subset of computer languages. The key distinction is (I think) the ability to express some kind of computation. Many introductory PL texts start with a simple language of arithmetic. AFAIK HTML cannot be used to express even simple arithmetic. The semantics of HTML are structural rather than computational. --Allan McInnes (talk) 20:25, 19 June 2006 (UTC)Reply
And before anyone jumps on me for not providing a citation for the use of "ability to express computation" as a criteria for defining programming languages, I quote from the scope section of the Bylaws of the ACM SIGPLAN:
The scope of SIGPLAN is the theory, design, implementation, description, and application of computer programming languages - languages that permit the specification of a variety of different computations, thereby providing the user with significant control (immediate or delayed) over the computer's operation. (emph. mine)
--Allan McInnes (talk) 20:44, 19 June 2006 (UTC)Reply

Ada

I note that Macrakis has again reverted the mention of Ada as a general-purpose programming language. In order to forestall another revert war, I'd like to point out the following, which support Macrakis:

  1. The Ada programming language article specfically states that Ada was originally created for embedded systems.
  2. The Ada Steelman language requirements document contains the following, which also confirms Macrakis' assertion that Ada was created a an embedded language rather than a general-purpose language
The technical requirements for a common DoD high order programming language given here are a synthesis of the requirements submitted by the Military Departments. They specify a set of constraints on the design of languages that are appropriate for embedded computer applications (i.e., command and control, communications, avionics, shipboard, test equipment, software development and maintenance, and support applications). (emph. mine)

--Allan McInnes (talk) 20:20, 19 June 2006 (UTC)Reply