Computer programming languages
Computer programming languages are structured systems that enable humans to communicate instructions to computers. They serve as a bridge between human logic and machine operations, allowing for the creation and execution of software applications. The evolution of programming languages has led to various categories, primarily distinguished by their level of abstraction. Low-level languages, such as machine code and assembly languages, offer direct control over hardware but are challenging for humans to read and write. In contrast, high-level languages, like C++, Java, and Python, prioritize ease of use and readability, making them more accessible for programmers while still efficiently generating machine code.
Programming languages can also be classified based on their paradigms, such as imperative and declarative styles, which dictate how instructions are structured. Syntax defines the grammatical rules of these languages, while semantics governs the meaning behind the commands. Programmers often use pseudocode to outline algorithms in a more intuitive form before coding. The process of converting high-level code into executable machine code involves compilers and linkers, ensuring that programs run correctly. As technology advances, programming languages continue to evolve, enabling increasingly complex and powerful applications across various fields.
Computer programming languages
Computer programming languages provide a convenient, standardized way for people to instruct computers how to perform a task. The development of such languages, plus the programs that translate them into a form usable by a computer, have made it possible to develop computer applications more quickly and reliably, and have contributed substantially to the explosive increase in the use of computation in business, scientific applications, and daily life.
![A network graph showing the connections of programming languages based on influence relations available from Freebase. By yaph [CC-BY-SA-2.0 (http://creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons 89316936-89343.jpg](https://imageserver.ebscohost.com/img/embimages/ers/sp/embedded/89316936-89343.jpg?ephost1=dGJyMNHX8kSepq84xNvgOLCmsE2epq5Srqa4SK6WxWXS)
![Diagram of the general functionality of programming languages. By Hr.hanafi (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons 89316936-89344.jpg](https://imageserver.ebscohost.com/img/embimages/ers/sp/embedded/89316936-89344.jpg?ephost1=dGJyMNHX8kSepq84xNvgOLCmsE2epq5Srqa4SK6WxWXS)
![Programming language textbooks. A selection of programming language textbooks on a shelf. By User:K.lee (Own work) [Public domain], via Wikimedia Commons 89316936-89400.jpg](https://imageserver.ebscohost.com/img/embimages/ers/sp/embedded/89316936-89400.jpg?ephost1=dGJyMNHX8kSepq84xNvgOLCmsE2epq5Srqa4SK6WxWXS)
What Are Programming Languages?
Programming languages are constructed languages that are used to create computer programs. They relay sets of instructions that control the operation of a computer. A computer's central processing unit (CPU) operates through machine code. Machine code is based on numerical instructions that are incredibly difficult to read, write, or edit. Therefore, higher-level programming languages were developed to simplify the creation of computer programs. Programming languages are used to write code that is then converted to machine code. The machine code is then executed by a computer, smartphone, or other machine.
There are many different types of programming languages. First-generation, or machine code, languages are processed by computers directly. Such languages are fast and efficient to execute. However, they are difficult for humans to read and require advanced knowledge of hardware to use. Second-generation languages, or assembly languages, are more easily read by humans. However, they must be converted into machine code before being executed by a computer. Second-generation languages are used more often than first-generation ones because they are easier for humans to use while still interacting quickly and efficiently with hardware.
Both first- and second-generation languages are classified as low-level languages. Third-generation languages are the most widely used programming languages. Third-generation, or high-level programming, languages are easier to use than low-level languages. However, they are not as fast or efficient. Early examples of such languages include Fortran, COBOL, and ALGOL. Some of the most widely used programming languages in the twenty-first century are third-generation. These include C++, C#, Java, JavaScript, and BASIC. Programming languages with higher levels of abstraction are sometimes called fourth-generation languages. Higher levels of abstraction increases platform independence. Examples include Ruby, Python, and Perl.
Programming languages can be based on different programming paradigms or styles. Imperative languages, such as COBOL, use statements to instruct the computer to perform a specific sequence of operations to achieve the desired outcome. Declarative languages specify the desired outcome but not the specific sequence of operations that will be used to achieve it. Structured Query Language (SQL) is one example.
Programming languages can also be classified by the number of different computations they can perform. Turing complete programming languages can perform all possible computations and algorithms. Most programming languages are Turing complete. However, some programming languages, such as Charity and Epigram, can only perform a limited number of computations and are therefore not Turing complete.
How Programming Languages Are Structured
The basic structural rules of a programming language are defined in its syntax and semantics. A programming language's syntax is the grammar that defines the rules for how its symbols, such as words, numbers, and punctuation marks, are used. A programming language's semantics provide the rules used to interpret the meaning of statements constructed using its syntax. For example, the statement 1 + pizza might comply with a programming language's syntax. However, adding a number and a word together (as opposed to adding two numbers) might be semantically meaningless. Programs created with a programming language must comply with the structural rules established by the language's syntax and semantics if they are to execute correctly.
Abstraction reduces the structural complexity of programs. More abstract languages are easier to understand and use. Abstraction is based on the principle that any piece of functionality that a program uses should be implemented only once and never duplicated. Abstraction focuses only on the essential requirements of a program. Abstraction can be implemented using subroutines. A subroutine is a sequence of statements that perform a specific task, such as checking to see if a customer's name exists in a text file. If abstraction is not used, the sequence of statements needed to check if a customer's name exists in the file would need to be repeated every place in the program where such a check is needed. With subroutines, the sequence of statements exists in only one place, within the subroutine. Thus, it does not need to be duplicated.
Using Pseudocode
The programming language statements that comprise a program are called "code." Code must comply with all of the programming language's syntax and semantic rules. Pseudocode uses a combination of a programming language and a natural language such as English to simply describe a program or algorithm. Pseudocode is easier to understand than code and is often used in textbooks and scientific publications.
Applications
To produce a computer program in a higher-level language such as C, a programmer first plans how the problem will be approached and how it will be broken down into modules or procedures. For each procedure, the statements of the higher-level language are typed into the computer using an editing program, which saves the statements as alphabetic or symbolic characters in a "source code" file. The language compiler program is then invoked, which makes several passes through this file. Typically, the needed variables are identified and storage locations assigned automatically; each source code statement is then translated into symbolic languagelike instructions called "object code." At this point, if the compiler has found any syntactic errors in spelling or ordering that violate the rules for combining language elements, it issues warnings to the programmer, who must then correct the source code file and recompile it.
Traditionally, computer languages are much more strict than natural languages in requiring adherence to their rules because of the potentially serious consequences in misinterpreting programmer instructions. The failure of one multimillion-dollar space rocket, for example, was attributed to a misplaced comma in a program instruction. If no errors are found, a "linker" program is then used to combine the object modules from all the different procedures making up the program into the final, executable machine code version, substituting the actual addresses for the symbols used in each procedure. If this works correctly when it is executed, the program is complete, though it is more likely that the programmer has inadvertently included logical errors in the program that must be eliminated by a process of testing or by using special "debugging" programs to analyze what is happening at the machine level. Although these steps take some computer time, the saving in programmer time afforded by higher-level language more than compensates for the expense of the compilation. The code produced by modern "optimizing compilers" runs as efficiently as that produced by all but the best assembly-language programmers, so most programs today are written in higher-level languages. Only if the highest possible speed is desired, or if a given higher-level language does not provide access to a given feature of the processor, is a critical portion of a program recoded in another language.
Some languages such as BASIC or FOCAL were designed so that language statements could be executed immediately as soon as they were typed in, allowing programs to be written and "debugged" in an interactive manner. They are easy to learn, and their translators, called "interpreters," have advantages for small programs but are less efficient than compilers for large programs or problems that need high execution speeds. In the 1980s, some programming firms produced "programming environments" for several languages, which combine an editor in which to write and alter the source program, an interpreter for quick testing, a debugging program to detect errors, a file manager to keep track of all the program modules, and a compiler to produce the finished program. Program libraries—a set of utility routines that extend the features of a language (for example in the area of graphics or database processing) and may be called or executed from the program—are a very important part of modern language implementations.
Principal terms
ASSEMBLY LANGUAGE: a set of instructions using memorable symbols and data addresses that translate into one equivalent computer machine instruction
COMPILER: a computer program that translates the entire program written in source code into a form that can then be directly executed by a computer
HIGH-LEVEL LANGUAGE: a computer language in which each line or statement usually translates to several machine code instructions
INTERPRETER: a computer program that translates and immediately executes one line of source code at a time
MACHINE LANGUAGE: a set of instructions specifying the operations of a particular computer processor; usually coded in binary form
SOURCE CODE: the instructions or text of a computer program written in a given programming language
Bibliography
Friedman, Daniel P., and Mitchell Wand. Essentials of Programming Languages. MIT P, 2006.
Harper, Robert. Practical Foundations for Programming Languages. Cambridge UP, 2013.
Hierso, Severine. "Coding From 1849 to 2022: A Guide to the Timeline of Programming Languages." IEEE Computer Society, 10 June 2022, www.computer.org/publications/tech-news/insider-membership-news/timeline-of-programming-languages. Accessed 2 Oct. 2024.
MacLennan, Bruce J. Principles of Programming Languages: Design, Evaluation, and Implementation. Oxford UP, 1999.
Ramsey, Norman. Programming Languages: Build, Prove, and Compare. Cambridge UP, 2023.
Scott, Michael L. Programming Language Pragmatics. Kaufmann, 2009.
Van Roy, Peter. Concepts, Techniques, and Models of Computer Programming. MIT P, 2004.
Watt, David A. Programming Language Design Concepts. Wiley, 2004.