Programming language: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Pat Palmer
(weird computer scientist really do write "human readable" instead of "humanly readable" (sorry! it's VERY common))
imported>Pat Palmer
(revision of intro)
Line 1: Line 1:
A '''programming language''' is a human readable lexicon and grammar that a [[programmer]] uses to instruct a computer how to operate.
A '''programming language''' is a human-readable [[lexicon]] and [[grammar]] that a [[programmer]] uses to instruct a [[computer]] how to operate.  Programs written in a programming language have to be translated into [[machine code]].  Machine code consists of multiple lower-level instructions which the computer can actually understand. Use of a programming language allows programmers to work at a higher level than machine code (which is not human-readable).


Programs written in a programming language have to be translated into a code (directly, or indirectly through an interpreter) the central processing unit ([[CPU]]) can understand and execute [[machine code]]. The programming language allows the programmer to define [[data structure]]s and combine them with logic and procedural instructions. Generally a programming language reflects the state of development of the hardware and its processing power.
One way in which various programming languages have traditionally been categorized is as [[compiler|compiled]] vs. [[interpreter|interpreted]] languages. The traditional view was that ''compiled'' languages were first translated, by a ''compiler'' program, from human-readable [[source code]] into [[binary numeral system|binary]] [[machine code]], and conversely, ''interpreted'' languages relied, at run time, on a special runtime application, called the ''interpreter'', to translate [[source code]] line by line into [[machine code]] during program executionHowever, the division between compiled languages and interpreted languages has blurred with the advent of hybrid platforms such as [[Java programming language|Java]] and the .NET framework ([[C sharp|C#]] and [[Visual Basic .NET|VB.NET]]).  These hybrid languages require sophisticated, optimized "runtime" engines to execute, and the runtime engines use Just-In-Time compilers to generate native machine code (but not on a line-by-line basis as in traditional "interpreters").
 
<!--A '''[[linker]]''' is often applied to this code to assemble it with existing libraries and runtime environments into a form the computer can run.-->
Programming languages can ''generally'' be divided into two categories:
 
'''Compiled''' languages must first be translated by a '''[[compiler]]''' from human readable [[source code]] to an [[object code]]. A '''[[linker]]''' is often applied to this code to assemble it with existing libraries and runtime environments into a form the computer can run.
 
'''Interpreted''' languages rely on an application, the '''[[interpreter]]''', that translates the (sometimes human readable) source code into machine code through pre-existing interfaces. For example, an interpreter would read a line such as this: <code>PRINT "Cookies are yummy!"</code> and call the predefined, '''platform independent''' function <code>PRINT</code> inside the interpreter itself where the interpreter then executes the '''platform dependent''' [[function call]] that corresponds with <code>PRINT</code>The division between compiled languages and interpreted languages is becoming fuzzier with platforms such as [[Java programming language|Java]] and the .NET framework, both of which require sophisticated, optimized "runtime" engines to execute a program, but include Just-In-Time compilation to native code.


==See Also==
==See Also==

Revision as of 18:37, 26 April 2007

A programming language is a human-readable lexicon and grammar that a programmer uses to instruct a computer how to operate. Programs written in a programming language have to be translated into machine code. Machine code consists of multiple lower-level instructions which the computer can actually understand. Use of a programming language allows programmers to work at a higher level than machine code (which is not human-readable).

One way in which various programming languages have traditionally been categorized is as compiled vs. interpreted languages. The traditional view was that compiled languages were first translated, by a compiler program, from human-readable source code into binary machine code, and conversely, interpreted languages relied, at run time, on a special runtime application, called the interpreter, to translate source code line by line into machine code during program execution. However, the division between compiled languages and interpreted languages has blurred with the advent of hybrid platforms such as Java and the .NET framework (C# and VB.NET). These hybrid languages require sophisticated, optimized "runtime" engines to execute, and the runtime engines use Just-In-Time compilers to generate native machine code (but not on a line-by-line basis as in traditional "interpreters").

See Also

List of programming languages