what is computer language ???

What makes a computer language? Why do computers have them? Why are there so many different computer languages?


                            HISTORY OF PROGRAMMING


Computers are electronic, and they are digital. To a computer everything is in terms of no voltage potential along a wire, or some voltage available. No voltage means a zero to the computer, and some voltage means a one. Computers can't actually count higher than that without combining multiple ones and zeros.
In the early days, switches were used to load ones or zeros into computer memory.
The front panel switches were used to load in the program. The lights showed the output. There was no monitor.















Each set of on/off switches represented a number. Each number would represent data or an instruction for the computer to perform. This system of only using ones and zeros to represent numbers is called the binary number system. This type of computer language is called a 1GL, or first generation programming language.
Binary numbers are usually represented in groups of four. For example:
1010 0010 0011
Both data and computer instructions are stored in binary. Machine language are the binary numbers representing instructions that the computer interprets. Not all binary data is machine language however. Data such as documents, databases, financial figures are also stored in binary on the computer. This data is, of course, not intended to be run by the computer.
An improvement over entering programs via switches was the use of hexadecimal codes. The decimal numbers used by most people use the digits 0-9. Hexadecimal uses the numbers 0-9 and A-F to represent a set of four switches, or the numbers 0-15. See the table below for an idea of how binary, decimal, and hexadecimal relate.
BinaryDecimalHexadecimal
000
111
1022
1133
10044
10155
11066
11177
100088
100199
101010A
101111B
110012C
110113D
111014E
111115F
1 00001610
1 00011711

In order to make entering programs easier, later computers allowed users to enter programs using assembly language. Each command used a mnemonic, and a program called a compiler would change the mnemonics into the numbers that represented the commands. This type of language is called a 2GL language, or second generation language.


While this was an improvement, it still wasn't very easy to program. The next generation of languages allowed for higher-level abstractions. The first of the third generation languages (COBOL, FORTRANand LISP) were a lot easier to understand and program.


The second and third generation languages used a program called a compiler. A compiler takes the program typed in by the user (called source code) and turns it into machine code. The programmer then runs the machine code. The original source code is not run.


If there are several pieces of source code in a program, they can be linked together into one program with the use of a program called a linker. The linker is run on the machine code generated by the compiler to generate a final program. This final program is what the user runs, and the original source code is not needed.




A disadvantage of compiling to machine language is that the program only works for that particular type of machine. Programs compiled for Windows computers do not work on Apple Macintosh computers, or Linux computers.


Because the whole compile and link steps could be complex for new programmers, some languages instead ran using interpreters. These programs look at the source code and interpret it to machine language instructions on the fly. It also allows the same programs to run on Windows, Mac, and Unix computers, provided there is an interpreter available for each platform.


The drawback of using interpreters is that it is slower to operate through an interpreter than in the machine's native language.
fig.interpreter


Python is an example of an interpreted language. It is easier to develop in Python than C, but Python runs slower and must have a Python interpreter to work.
Languages such as Java use a system where programs are compiled to machine code that runs on a Java Virtual Machine (JVM), rather than the actual machine. Another popular language that does this is C#, a Common Language Infrastructure (CLI) language that runs on the Virtual Execution System (VES) virtual machine. A full discussion of these is beyond the scope of this book, but feel free to read up on them.
There are many different computer languages today. Because computers perform so many types of tasks, different languages have been developed that specialize in these tasks. Languages such as C are good for operating systems and small embedded computers. Other languages like PHP specialize in creating web pages. Python is a general purpose language that specializes in being easy-to-use.
The company Tiobe keeps track of the popularity of various programming language in their index that is updated each month. It is a good idea to look here, and at job placement boards like DICE to keep up to date with what languages employers are looking for.
Thankfully almost all languages share the same common elements, and once one language has been learned, the same theories will apply to the other languages.