Programming language: Difference between revisions

[accepted revision][accepted revision]
Content deleted Content added
updated citation, citation style
Tradeoffs: Grammar edit
Tags: Mobile edit Mobile web edit
 
(6 intermediate revisions by 6 users not shown)
Line 10:
Programming languages typically allow software to be [[Software development|written]] in a [[Human-readable|human readable]] manner.
 
[[Execution (computing)|Execution]] of a program is requires an [[Programming language implementation|implementation]]. There are two main approaches for implementing a programming language {{endash}} [[Compiler|compilation]], where programs are compiled to ahead-of-time to [[machine code]], and [[Interpreter (computing)|interpretation]], where programs are directly executed. In addition to these two extremes, some implementations use hybrid approaches such as [[just-in-time compilation]] and [[bytecode]] interpreters.<ref>{{Cite book|title=Concepts of Programming Languages|last=Sebesta|first=Robert W.|publisher=Pearson|year=2023|isbn=978-1-292-43682-1|edition=12th global|pages=46-5146–51|language=en}}</ref>
 
The design of programming languages has been strongly influenced by [[computer architecture]], with most [[imperative languages|imperative]] languages designed around the ubiquitous [[von Neumann architecture]].{{Sfn|Sebesta|p=18}}{{full citation needed|date=August 2025}} While early programming languages were closely tied to the [[Computer hardware|hardware]], modern languages often hide hardware details via [[abstraction (computer science)|abstraction]] in an effort to enable better software with less effort.{{Citation needed|date=August 2025}}
 
==Related==
Line 155:
Desirable qualities of programming languages include readability, writability, and reliability.{{sfn|Sebesta|2012|p=8}} These features can reduce the cost of training programmers in a language, the amount of time needed to write and maintain programs in the language, the cost of compiling the code, and increase runtime performance.{{sfn|Sebesta|2012|pp=16–17}}
*Although early programming languages often prioritized efficiency over readability, the latter has grown in importance since the 1970s. Having multiple operations to achieve the same result can be detrimental to readability, as is [[operator overload|overloading operators]], so that the same operator can have multiple meanings.{{sfn|Sebesta|2012|pp=8–9}} Another feature important to readability is [[orthogonality]], limiting the number of constructs that a programmer has to learn.{{sfn|Sebesta|2012|pp=9–10}} A syntax structure that is easily understood and [[reserved word|special word]]s that are immediately obvious also supports readability.{{sfn|Sebesta|2012|pp=12–13}}
*Writability is the ease of use for writing code to solve the desired problem. Along with the same features essential for readability,{{sfn|Sebesta|2012|p=13}} [[abstraction (computer science)|abstraction]]—interfaces that enable hiding details from the client—and [[Expressive power (computer science)|expressivity]]—enabling more concise programs—additionally help the programmer write code.{{sfn|Sebesta|2012|pp=14–15}} The earliest programming languages were tied very closely to the underlying hardware of the computer, but over time support for abstraction has increased, allowing programmers to express ideas that are more remote from simple translation into underlying hardware instructions. Because programmers are less tied to the complexity of the computer, their programs can do more computing with less effort from the programmer.<ref>Frederick P. Brooks, Jr.: ''The Mythical Man-Month'', Addison-Wesley, 1982, pp. 93–94</ref> Most programming languages come with a [[standard library]] of commonly used functions.<ref>{{cite journal |last1=Busbee |first1=Kenneth Leroy |last2=Braunschweig |first2=Dave |title=Standard Libraries |url=https://press.rebus.community/programmingfundamentals/chapter/standard-libraries/ |website=Programming Fundamentals – A Modular Structured Approach |access-date=27 January 2024 |language=en |date=15 December 2018}}</ref>
*Reliability means that a program performs as specified in a wide range of circumstances.{{sfn|Sebesta|2012|p=15}} [[Type checking]], [[exception handling]], and restricted [[aliasing (computing)|aliasing]] (multiple variable names accessing the same region of memory) all can improve a program's reliability.{{sfn|Sebesta|2012|pp=8, 16}}
Programming language design often involves tradeoffs.{{sfn|Sebesta|2012|pp=18, 23}} For example, features to improve reliability typically come at the cost of performance.{{sfn|Sebesta|2012|p=23}} Increased expressivity due to a large number of operators makes writing code easier but comes at the cost of readability.{{sfn|Sebesta|2012|p=23}}
 
{{anchor|English-like programming languages}}
[[Natural-language programming]] has been proposed as a way to eliminate the need for a specialized language for programming. However, this goal remains distant and its benefits are open to debate. [[Edsger W. Dijkstra]] took the position that the use of a formal language is essential to prevent the introduction of meaningless constructs.<ref>Dijkstra, Edsger W. [http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD667.html On the foolishness of "natural language programming."] {{webarchive|url=https://web.archive.org/web/20080120201526/http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD667.html |date=20 January 2008 }} EWD667.</ref> [[Alan Perlis]] was similarly dismissive of the idea.<ref>{{cite web|last=Perlis|first=Alan|url=http://www-pu.informatik.uni-tuebingen.de/users/klaeren/epigrams.html|title=Epigrams on Programming|work=SIGPLAN Notices Vol. 17, No. 9|date=September 1982|pages=7–13|url-status=live|archive-url=https://web.archive.org/web/19990117034445/http://www-pu.informatik.uni-tuebingen.de/users/klaeren/epigrams.html|archive-date=17 January 1999}}</ref>
 
===Specification===
{{Main|Programming language specification}}
Line 306 ⟶ 307:
* [[Ellis Horowitz]] (ed.): ''Programming Languages, a Grand Tour'' (3rd ed.), 1987.
* Ellis Horowitz: ''Fundamentals of Programming Languages'', 1989.
* [[Shriram Krishnamurthi]]: ''[[Programming Languages: Application and Interpretation]]'', [httphttps://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/ online publication] {{Webarchive|url=https://web.archive.org/web/20210430210417/http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/ |date=30 April 2021 }}.
*{{cite book |last1=Gabbrielli |first1=Maurizio |last2=Martini |first2=Simone |title=Programming Languages: Principles and Paradigms |date=2023 |publisher=Springer |isbn=978-3-031-34144-1 |language=en|edition=2nd}}
* [[Bruce J. MacLennan]]: ''Principles of Programming Languages: Design, Evaluation, and Implementation'', [[Oxford University Press]] 1999.