What is a programming language?: Difference between revisions

From Computer Science Wiki
No edit summary
Line 2: Line 2:


A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms.<ref>https://en.wikipedia.org/wiki/Programming_language</ref>
A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms.<ref>https://en.wikipedia.org/wiki/Programming_language</ref>
== Fundamental operations of  a computer ==


The most basic instructions a computer can be given are:  
The most basic instructions a computer can be given are:  
Line 10: Line 12:
* STORE  
* STORE  


Complex capabilities are composed of simple operations.
== Compound operations ==
 
Compound operations are composed of very large numbers  of fundamental operations. For example, if we wanted to multiply, we would simply add groups of numbers until we had found our solution.  


If we ask a simple question: what is the biggest item on this list, we might use '''complex''' code like this:
If we ask a simple question: what is the biggest item on this list, we might use '''complex''' code like this:
Line 30: Line 34:


</syntaxhighlight>
</syntaxhighlight>
== Review the ALU ==
<html>
<iframe width="560" height="315" src="https://www.youtube.com/embed/1I5ZMmrOfnA?list=PLME-KWdxI8dcaHSzzRsNuOLXtM2Ep_C7a" frameborder="0" allowfullscreen></iframe>
</html>


== An example ==
== An example ==

Revision as of 06:44, 9 August 2017

Programming basics[1]

A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms.[2]

Fundamental operations of a computer[edit]

The most basic instructions a computer can be given are:

  • ADD
  • COMPARE
  • RETRIEVE
  • STORE

Compound operations[edit]

Compound operations are composed of very large numbers of fundamental operations. For example, if we wanted to multiply, we would simply add groups of numbers until we had found our solution.

If we ask a simple question: what is the biggest item on this list, we might use complex code like this:

$list_of_numbers = [12,1,54,8,19,4,13,21,12,89,-1,6]

echo max($list_of_numbers);

But the computer (using fundamental operations) will process the above instructions like this:

LOAD register 00001
ADD 12
STORE result
COMPARE result to register 0002

Review the ALU[edit]

An example[edit]

Below is an example of a program language designed to communicate instructions to a machine. The piano is "fed" instructions which enable it to play a simple song. The song is an example of a program. Can you imagine how difficult it might be to "write" these instructions?!?

Essential features of a programming language[edit]

  • Fixed vocabulary
  • Unambiguous meaning
  • Consistent grammar & syntax

Do you understand this?[edit]

Standards[edit]

  • State the fundamental operations of a computer.
  • Distinguish between fundamental and compound operations of a computer.
  • Explain the essential features of a computer language.
  • Explain the need for higher level languages.
  • Outline the need for a translation process from a higher level language to machine executable code.

References[edit]