What characterizes a programming language?

Asked

Viewed 2,857 times

39

A long time ago I saw in the laboratory a "program" called POV-Ray and a doubt prompted me. The teacher said it is a "programming language" and argued, now it has source code, syntax, semantics and compiler so it’s a programming language.

It is correct to make such a statement using these arguments?

How can we define a programming language? What elements it is necessary to be present in order to be framed?

  • 10

    Related: http://answall.com/q/101691/3084

  • I find this answer perfect for the case: http://answall.com/a/99665/3635. in addition to the one already cited by @Cantoni

  • 2

    Or duplicate one of them? Any of the above links answer your question?

  • @bfavaretto I was scoring as duplicate even :) It’s that I wanted to understand what he was saying from POV-ray. Tavelz would have been better off asking "pov-ray is a programming language?"

  • by reading this answer http://answall.com/a/99666/12032 and this one http://answall.com/a/99665/12032 I stayed in the same when I had not read either of them, meaning that being a Turing Complete is already considered a programming language? simply have infinite loop option ?

  • 1

    I reopened the question because the one I had indicated as duplicate was not good for what you want to know. But I still think the other answers. And what do you mean "just having an infinite loop"? That’s not what defines Turing Complete.

  • 2

    Perhaps the right question to ask is what is a programming language general purpose. Because a language may not be Turing complete and yet be used to "program" (in the sense of exercising control over an automated tool). SQL, to my knowledge, is not complete Turing, but is used to "program" a database. GLSL has very limited scope, but is used to "program" the GPU. Etc. I doubt a system of raytracing be Turing complete, but if this POV-Ray allows you to control the image generation process, I would say yes that it is "programming".

  • 1

    @mgibsonbr is in this sense even my question, in the case of programming language what requirements are necessary for it to be classified as such

  • @Sneepsninja has something I can do to improve the answer?

  • I would like a full answer, maybe you have too detailed your answer and I have not been able to understand, I can say then that the programming language is all that can implement a Turing machine ?

  • @Sneepsninja exactly that. If you were to sum up in a sentence.

Show 6 more comments

3 answers

26


The theory

The most accepted definition is that the language needs to be Turing-Complete, or that can simulate the Universal Turing Machine to be considered programming. That means any function that can be mathematically calculated in some way, it must be possible to express, and consequently to execute, in its fullness, generating correct and expected results through these languages.

The theory does not speak of how this can be obtained, but obviously it is necessary to achieve the goal by own means, it cannot depend on external forms to what has been defined in it to achieve the result.

The theory does not say what is the concrete means of execution. No matter that this is converted to another language or code that actually allows you to perform the calculation, it is normal that it happens.

The theory also doesn’t talk about the architecture of the machine that will run, doesn’t need to be electric, doesn’t need to have a processor.

It leaves open that language can express the problem in the simplest or most complex way, making it easier or difficult for humans or machines to understand what it is (obviously these two characteristics are antagonistic, which is easy for the first, difficult for the second and vice versa). It doesn’t matter if it is represented by bits or something else esoteric that this (yes something is possible crazy, made-up) or a poetic text using pinched verses of the great Lusophone authors in the best and most elaborate Portuguese (if this is possible to exist).

Hardware

The abacus was a computing device (a pity not to be used in schools anymore, that must be why people can no longer make a simple percentage account), but it does not have a programming language, there is no way to express mathematical functions in it. The same goes for all the mechanical machines and even some electromechanical ones until the decade of 40 (of the century 20, goes that it survives some 3 or 4 decades and the people of the future get confused :) ).

The modern computer emerged during a rapid evolution during World War II (always the military use being the force for every push in technology). There emerged the computer that could do all kinds of calculations in an abstract, automatic and mainly programmable way, although in a rudimentary way.

It is possible that other machines may have had the ability to program, but because they did not have other characteristics became less famous, they ended up being relegated to a branch of evolution that did not go forward.

The performance of the show was manual and I have no reference to how they did it. I know it was keyed through binary coding, but there was probably something at a higher level being accomplished on paper before it came to this.

There was already a low-level programming language on this device. And they probably used another language before.

First languages

It was clear at the time that higher-level languages were needed. Assembly was soon invented and then assemblers to convert this code to something lower level. Mainly after data entry might be made more conveniently than binary keys, such as card reading punched through an adapted typewriter.

Then there were languages that began to approach the notation used in mathematics and the use of English. Fortran was the first that had good organization and was successful for being a clear step forward.

See the Timeline the creation of programming languages (best possible effort).

Necessary components

I’m going to risk making a mistake here, I’m telling you something that I see happening and I’m not following a formal definition. So to solve any computational problem you need to be able to:

  • store - and read obviously - data somewhere at least transiently - maintain status (not I/O);
  • transform data to express the simplest mathematical operations (I would say that addition and multiplication in their most basic form are necessary);
  • maintain a "run" sequence - logically organize the stores and transformations;
  • divert the sequence;
  • take a decision between at least 2 "paths".

I may have forgotten something or I may have put something that is already an abstraction of another cited.

Some people may say that the last three can be defined as having the ability to recur. That’s one way of putting it, but I don’t know if everyone will understand it. And I don’t know if that’s abstracting the concept a little bit.

It is no wonder that the languages that are successful are the imperatives, even if they carry some other paradigm to assist.

More information on:

  • Who negative can say if there is something wrong in the answer?

  • I have some disagreements about item 2 (if my understanding was what he really intended to express), because with the unary numbering system it is possible to write the sum operation and, from it, multiplication and subtraction.

  • What is an unary numbering system? Show how to do.

  • What is anointing? https://en.wikipedia.org/wiki/Unary_numeral_system?wprov=sfsi1 ; Show how to do I will need a little patience, the best example is with Turing machine, do (or look for a MT to that end) as soon as I get home

  • I thought of binary that has practical use to speak in real programming language and not just conceptual. In practice the basic operations with binaries are addition and multiplication, the others are derived, so it may be that conceptually it works, but again it is not practical.

  • there is binary summation algorithm as well, which is better to write as a Turing machine. I put this disagreement in a reply edition of mine (so much so that I forgot to change the caller from "the original author" to "you"). How you dealt with Turing completeness, it is important to emphasize concepts. Again, it is not practical, just as an MT would do too many operations for simple one-step tasks.

Show 1 more comment

2

From the common source (Wikipedia) has a very simple answer:

A programming language is a standardized method for communicating instructions to a computer.

That is, if somehow you communicate with the computer in an organized way ,already if using a programming language. Remember that there are guys or classifications of languages, and some of them have no compiler, but still communicate with the computer (Interpreted).

1

"Programming language is a more abstract concept, are the rules specified governing how a code must behave to produce computer programs. Language is not a program that runs." -Excerpt used by @Maniero in that reply;

"- Programming: Languages that use human logic to solve various problems using more complex commands like. SE ( if ), So ( then), do ( do ), for ( for ).

Example of programming languages is JAVA, PHP, JAVASCRIPT, C++ and Pascal." http://progplay.blogspot.com.br/2013/03/linguagem-de-marcacao-x-linguagem-de.html

In a more personal answer, I do not think it is correct to say that it is a programming language, because it contains source code, syntax...that HTML has, and HTML is not a programming language however, it contains source code and we must obey a syntax. The Programming Language must have logic and perform processing (calculations, conversions, data manipulation)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.