4

Wikipedia says:

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication.

But is this true? It occurred to me in the shower this morning that a programming language might just be a set of conventions, something that both a human and an appropriately arranged compiler can interpret. If that's the case, then isn't it this definition of a programming language misleading? If that isn't the case, then what's the difference between a compiler and the language it compiles?

Thanks!

z.

askedMay 15, 2009 at 17:39
Ziggy's user avatar

8 Answers8

6

A programming language is exactly that set of conventions, but I don't see why that makes the Wikipedia entry misleading, really. If it makes you feel better, you might edit it to read something like:

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used todefine programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication.

answeredMay 15, 2009 at 17:43
mqp's user avatar
Sign up to request clarification or add additional context in comments.

Comments

4

I understand what you are saying, and you are right. Describing a programming language as a "machine-readable artificial language designed to express computations that can be performed by a machine" is unnecessarily specific. Programming languages can be more broadly generalized as established descriptions of tasks (or "a set of conventions") that allow one entity to control the behavior of another. What we traditionally identify as programming languages are just a layer of abstraction between machine code and programmers, and are specifically designed for electronic computers.

Programming languages are not limited to traditional computers (see theK'NEX Computer), and aren't even necessarily limited to computational devices at all. For example, when I am pleased with my dog's behavior, he gets a treat. When I am displeased, he gets nothing. Over time the dog learns the treat/no treat programming and I can use the treats to control his behavior (to an extent).

answeredMay 15, 2009 at 17:57
Bobwise's user avatar

1 Comment

your dog might argue that he is controlling your behavior. ㅋㅋㅋ
4

I don't see what is different between what you are asking...

It occurred to me in the shower this morning that a programming language might just be a set of conventions, something that both a human and an appropriately arranged compiler can interpret.

... and the Wikipedia definition.

The key is that a programming language is just "a machine-readable artificial language".

answeredMay 15, 2009 at 17:43
matt b's user avatar

3 Comments

what makes it machine readable, I think that's my question. What does machine readable mean. Thanks!
Well, machines have a built-in programming language that is extremely simple. It's interpreted by the CPU, and consists of instructions that map directly to the CPU's hardware capabilities. So that's the only truly "machine-readable" language on your computer. Other compilers are more or less intermediary tools to translate from more abstract programming languages into this very simple language.
And that one's machine-readable because it's built into the hardware. The CPU is hard-wired to look in specific places for the instructions it understands and to respond appropriately. The others, by proxy, are machine-readable since we have created a system to translate between them.
4

A compiler does indeed act as an effective specification of a language in terms of a reduction to machine code - however, as it's generally difficult to understand a language by reading the compiler's source, one generally considers a programming language in terms of an abstract processing model that the compiler implements. This abstract model is what one means when one refers to the programming language.

That said, there are indeed many languages (Hi there, PHP!) in which the compiler is the only specification of the language in existence. These languages tend to change unpredictably at times as compiler bugs are fixed or introduced.

answeredMay 15, 2009 at 17:44
bdonlan's user avatar

2 Comments

The compiler might also have bugs or purposeful omissions and changes; there's no guarantee that any compiler is actually a 100% faithful representation of a language (assuming that the language designers have created a formal specification elsewhere.)
It is, however, a 100% faithful representation ofthe language that it implements, which may not be equivalent to the language the programmer has in mind.
2

Programming languages are an abstraction layer that helps insulate the programmer from having to talk in electrical signals to the computer. The creators of the language have done all the hard work in creating a structure (language) or standard (grammar, conjugation, etc.) that then can be interpreted by a compiler in terms that the computer understands.

answeredMay 15, 2009 at 17:48
Wayne Hartman's user avatar

Comments

1

All programming languages are really nothing more than domain specific languages for machine code or manipulating the registers and memory of a processing entity.

answeredMay 15, 2009 at 18:57
ennuikiller's user avatar

Comments

1

This is probably the true explanation of what a programming language really is:

Step 1: Think of a language and its grammar, which is a set of rules for making syntactically valid statements using the language. For example, a language called GRID has tiles {0,1} as its alphabet and grammar rules that make sure every GRID statement has equal length and height.

Step 2 (definition of program): GRID, so far, is useless. I'd dare to think of any valid statement of GRID as just data. We need to add something else to GRID: a successor function. So GRID={Grammar, alphabet, successor function}. To make this clear, lets use the rules of "The Game of Life" as successor function.

Step 3: The Game of Life is actually Turing Complete, so GRID={Grammar, alphabet, successor function = GOL} can perform any computation that is computable.

A programming language is nothing but a language with a successor function. The environment that evaluates a valid statement of the language(program) does nothing but follow those successor functions. Variables, for example, are things whose successor functions = (STAY THE SAME)

Computers are just very fast environments ;)

answeredFeb 16, 2016 at 5:23

Comments

0

Wikipedia's definition might have been taken out of context. For one thing, only programs written in machine code are machine-readable. Otherwise, you need a compiler to convert C++, Java or even assembly code to machine code so the computer can carry out your instructions. Unless you include comments that are only readable to humans, or unless you are strictly discussing a topic within the realm of your program, programming is insufficient for human communication.

answeredDec 29, 2018 at 23:16
K Man's user avatar

Comments

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.