| Line 1: |
Line 1: |
| − | A '''programming language''', sometimes called a '''scripting language''', is an artificial [[language]] used mainly for giving instructions to [[computer]]s; a secondary use is for the precise specification of [[algorithm]]s. A group of instructions for a particular purpose is known as a [[computer program]] (or script). | + | A '''programming language''', is an artificial [[language]] used mainly for giving instructions to [[computer]]s; a secondary use is for the precise specification of [[algorithm]]s. A group of instructions for a particular purpose is known as a [[computer program]]. |
| | | | |
| | When compared with human languages (e.g. English, French, Spanish, etc.), programming languages are very much smaller, much simpler, and are also more precise. Most programming languages consist of a mixture of English words and mathematical notation; very few programming languages have a base vocabulary exceeding 60 words, although they may also have utility libraries with hundreds of entries which provide optional extra functionality. | | When compared with human languages (e.g. English, French, Spanish, etc.), programming languages are very much smaller, much simpler, and are also more precise. Most programming languages consist of a mixture of English words and mathematical notation; very few programming languages have a base vocabulary exceeding 60 words, although they may also have utility libraries with hundreds of entries which provide optional extra functionality. |
| Line 20: |
Line 20: |
| | | | |
| | ==Classifying programming languages== | | ==Classifying programming languages== |
| − | The initial distinction is between '''low-level languages''' and '''high-level languages'''.
| + | Some programming languages are called '''scripting languages''', or '''command languages''', when they are interpreted by an operating system shell or as a way of programming other applications. However, the distinction between languages described with these different terms is largely arbitrary. Although scripting and command languages are usually interpreted and have a smaller grammers than other programming languages, there is nothing inherent about them that prevents them from being compiled instead of interpreted. Nor do they always act as an adjunct to other software as some of them can be used to write stand-alone programs. Further, some languages not labelled as "scripting languages", such as [[BASIC programming language|BASIC]], are interpreted, and versions of BASIC and Pascal have been used as scripting adjuncts to other software. In other words, the distinction is primarily one of usage and nothing inherent to the language itself. The most common languages used primarily for scripting are [[JavaScript]], [[PHP]], and Lua. |
| | + | |
| | + | ==Low-level vs High-level== |
| | + | Programming languages can be categorized by whether they are low-level or high-level. They can also be referred to by "generation". 1st-generation languages are the machine code of the [[CPU]]. 2nd-generation languages are the assembly languages. 3rd-generation languages are what most programmers use in the modern world and include such things as BASIC, C++, Pascal, and PHP. 4th-generation languages are domain-specific and offer productivity gains for programmers in those domains, but their narrow focus makes them unsuitable for solving problems outside of their specific domain. 1st- and 2nd-generation languages are categorized as low-level, while 3rd- and 4th-generation are categorized as high-level. Each generation abstracts the programming concepts further away from the hardware that runs the program. However, concepts and capabilities often cross these generational boundaries over time. |
| | | | |
| | ===Low-level languages=== | | ===Low-level languages=== |
| − | Low-level languages are generally referred to as '''assembly''' languages. Most instructions in such languages equate directly to a single machine instruction. Each machine architecture has its own assembly language, so programs written in such languages are generally very machine-specific and are not portable. The instructions in such languages are usually fairly cryptic, often using abbreviations such as ADD, JNE, LR, LI, etc. In the early days of computing (up to about late 1950's) most programming was done in [[assembly language]], partly due to the limited power and memory capacity of early computers. | + | Low-level languages are generally referred to as '''assembly''' languages. Most instructions in such languages equate directly to a single machine instruction. Each machine architecture has its own assembly language, so programs written in such languages are generally very machine-specific and are not portable to different hardware. The instructions in such languages are usually fairly cryptic, often using abbreviations such as ADD, JNE, LR, LI, etc. In the early days of computing (up to about late 1950's) most programming was done in [[assembly language]], partly due to the limited power and memory capacity of early computers. |
| | | | |
| | ===High-level languages=== | | ===High-level languages=== |
| − | High-level languages generally use a mixture of English words and simple mathematical notation, and are often available with little or no change on many different types of computers, depending on what [[compiler]]s are available on which computers. These are often referred to as 3rd-generation languages (the 1st generation was raw binary machine code, the 2nd was assembly language). A single high-level statement may be equivalent to using 3 to 10 assembly language statements, so programming in a high-level language can be much more productive. One of the key reasons for the success of high-level languages is that they provide a level of abstraction (sometimes several such levels). which means that a programmer can concentrate more on the problem to be solved and less on the detail of how to solve it. | + | High-level languages generally use a mixture of English words and simple mathematical notation, and are often available with little or no change on many different types of computers, depending on what [[compiler]]s are available on which computers. A single high-level statement may be equivalent to using 3 to 10 assembly language statements, so programming in a high-level language can be much more productive. One of the key reasons for the success of high-level languages is that they provide a level of abstraction (sometimes several such levels). which means that a programmer can concentrate more on the problem to be solved and less on the detail of how to solve it. |
| | | | |
| | There are a variety of different programming paradigms (styles of writing programs). Some programming languages really only support a single paradigm while others may support several. Possible paradigms include: imperative, declarative, procedural, functional, event-driven, object-oriented, list processing, and automata-based. | | There are a variety of different programming paradigms (styles of writing programs). Some programming languages really only support a single paradigm while others may support several. Possible paradigms include: imperative, declarative, procedural, functional, event-driven, object-oriented, list processing, and automata-based. |
| Line 64: |
Line 67: |
| | Programs which have been completely converted to machine code prior to use may easily run 10 times faster than programs which are interpreted. | | Programs which have been completely converted to machine code prior to use may easily run 10 times faster than programs which are interpreted. |
| | | | |
| − | There are no fixed rules as to which programming languages are processed in which way, and indeed most languages can be handled in any of these three ways. Many languages have been implemented in two or more of these ways. Traditionally compilers have been used for languages where performance is important (e.g. Fortran, '''C'''), interpreters have been used for languages where convenience of use is important (e.g. most scripting and command languages), and translation to intermediate code has been used when machine-independence is considered to be important (e.g. Java). | + | There are no fixed rules as to which programming languages are processed in which way, and indeed most languages can be handled in any of these three ways. Many languages have been implemented in two or more of them. Traditionally compilers have been used for languages where performance is important (e.g. Fortran, '''C'''), interpreters have been used for languages where convenience of use is important (e.g. most scripting and command languages), and translation to intermediate code has been used when machine-independence is considered to be important (e.g. Java, C#). |
| | | | |
| | ==Assorted Languages== | | ==Assorted Languages== |