Basa program: Béda antarrépisi
Konten dihapus Konten ditambahkan
Removing Link FA template as it is now available in wikidata |
m Ngarapihkeun éjahan, replaced: oge → ogé , nyaeta → nyaéta (5), make → maké (2), rea → réa (14), yen → yén (2), dipake → dipaké (6), ea → éa (44), kabeh → kabéh using AWB |
||
Baris ka-1:
'''Basa program'''
Basa program
[[Alphabetical list of programming languages|Rebuan basa program nu beda-beda]]<ref>[[as of 2006|As of May 2006]] [http://hopl.murdoch.edu.au/ The Encyclopedia of Computer Languages] by [[Murdoch University]], [[Australia]] lists 8512 computer languages.</ref> geus dijieun, tur meh unggal taun dijieun basa program nu anyar.
== Harti ==
Sifat penting keur nangtukeun pilihan basa program
* ''Fungsi:'' Basa program
* ''Target:'' Basa program beda jeung [[natural language|basa alami]]
* ''Konsep:'' Basa program mibanda sababaraha kompnen keur ngartikeun tur ngokolakeun [[data structure|struktur data]] atawa ngadalikeun [[control flow|kaputusan aliran]].
▲* ''Target:'' Basa program beda jeung [[natural language|basa alami]] yen dina basa alami ngan dipake keur antar manusa, sedengkeun dina basa program ngawenangkeun jalma keur nyieun parentah kana mesin. Sababaraha basa program dupake keur alat ngadalikeun nu sejenna. Contona program [[PostScript]] remen dijieun ku basa program sejenna keur ngadalikeun [[computer printer|printer]] atawa tampila.
* ''Kakuatan ekspresi:'' [[theory of computation|Teori komputasi]] misahkeun basa ku itungan nu bisa ditembongkeun (tempo [[Chomsky hierarchy|hirarki Chomsky]]).
▲* ''Konsep:'' Basa program mibanda sababaraha kompnen keur ngartikeun tur ngokolakeun [[data structure|struktur data]] atawa ngadalikeun [[control flow|kaputusan aliran]].
▲* ''Kakuatan ekspresi:'' [[theory of computation|Teori komputasi]] misahkeun basa ku itungan nu bisa ditembongkeun (tempo [[Chomsky hierarchy|hirarki Chomsky]]). Sakabeh basa [[Turing complete|Turing lengkep]] bisa dipake kana runtuyan [[algoritma]] nu sarua. [[SQL|ANSI/ISO SQL]] jeung [[Charity programming language|Charity]] conto basa Turing teu lengkep nu ilahar disebut basa program.<ref>{{cite web | author=Digital Equipment Corporation | title=Information Technology - Database Language SQL (Proposed revised text of DIS 9075) | url=http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt | work=ISO/IEC 9075:1992, Database Language SQL | accessdate=June 29 | accessyear=2006}}</ref><ref>{{cite web|author=The Charity Development Group|title=The CHARITY Home Page | url=http://pll.cpsc.ucalgary.ca/charity1/www/home.html | month=December|year=1996|accessdate=2006-06-29}}, ''Charity is a categorical programming language...'', ''All Charity computations terminate.''</ref>
Basa non-komputasi, saperti [[markup language|basa markup]] siga [[HTML]] atawa [[formal grammar]] siga [[Backus–Naur form|BNF]], ilaharna teu disebut basa program. Ilaharna basa program ditambahkeun kana basa non-itungan ieu.
== Kaperluan ==
Kaperluan utama basa program
{{tarjamahkeun|Inggris}}
Baris 28 ⟶ 25:
* Programmers range in expertise from novices who need simplicity above all else, to experts who may be comfortable with considerable complexity.
* Programs must balance speed, size, and simplicity on systems ranging from [[microcontroller]]s to [[supercomputer]]s.
* Programs may be written once and not change for generations, or they may undergo
* Finally, programmers may simply differ in their tastes: they may be accustomed to discussing problems and expressing them in a particular language.
One common trend in the development of programming languages has been to add more ability to solve problems using a higher level of [[Abstraction (computer science)|abstraction]]. The
[[Natural language and computation|Natural language processors]] have 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 Dijkstra]] took the position that the use of a formal language is essential to prevent the introduction of
== Elements ==
Baris 42 ⟶ 39:
A programming language's surface form is known as its [[syntax]]. Most programming languages are purely textual; they use sequences of text including words, numbers, and punctuation, much like written natural languages. On the other hand, there are some programming languages which are more [[visual programming language|graphical]] in nature, using spatial relationships between symbols to specify a program.
The syntax of a language describes the possible combinations of symbols that form a syntactically correct program. The
Programming language syntax is usually defined using a combination of [[regular expression]]s (for [[lexical analysis|lexical]] structure) and [[Backus-Naur Form]] (for [[context-free grammar|grammatical]] structure). Below is a simple grammar, based on [[Lisp programming language|Lisp]]:
Baris 63 ⟶ 60:
The following are examples of well-formed token sequences in this grammar: '<code>12345</code>', '<code>()</code>', '<code>(a b c232 (1))</code>'
Not all syntactically correct programs are semantically correct. Many syntactically correct programs are nonetheless ill-formed, per the language's rules; and may (depending on the language specification and the soundness of the implementation) result in an error on translation or execution. In some cases, such programs may exhibit [[undefined behavior]]. Even when a program is well-defined within a language, it may still have a
Using [[natural language]] as an example, it may not be possible to assign a
* "[[Colorless green ideas sleep furiously]]." is grammatically well-formed but has no generally accepted
* "John is a married bachelor." is grammatically well-formed but expresses a
The following C language fragment is syntactically correct, but performs an operation that is not semantically defined (because <tt>p</tt> is a [[null pointer]], the operations <tt>p->
complex *p = NULL;
complex abs_p = sqrt (p->
The grammar needed to specify a programming language can be classified by its position in the [[Chomsky hierarchy]]. The syntax of most programming languages can be specified using a Type-2 grammar, i.e., they are [[context-free grammar]]s.<ref>{{cite book|author = [[Michael Sipser]] | year = 1997 | title = Introduction to the Theory of Computation | publisher = PWS Publishing | id = ISBN 0-534-94728-X}} Section 2.2: Pushdown Automata, pp.101–114.</ref>
Baris 80 ⟶ 77:
{{details|Type safety}}
A type system defines how a programming language classifies values and expressions into ''types'', how it can manipulate those types and how they interact. This generally includes a description of the [[data structure]]s that can be constructed in the language. The design and study of type systems using formal mathematics is known as ''[[type theory]]''.
Internally, all [[data]] in modern digital computers are stored simply as zeros or ones ([[Binary numeral system|binary]]).
==== Typed versus untyped languages ====
A language is ''typed'' if operations defined for one data type cannot be performed on values of another data type.<ref name="typing">{{cite web | url=http://www.acooke.org/andrew/writing/lang.html#sec-types | author=Andrew Cooke | title=An Introduction to Programming Languages | accessdate=June 30 | accessyear=2006}}</ref> For example, "<code>this text between the quotes</code>" is a string. In most programming languages, dividing a number by a string has no
A special case of typed languages are the ''single-type'' languages. These are often scripting or markup languages, such as [[Rexx]] or [[SGML]], and have only one data type — most commonly character strings which are used for both symbolic and numeric data.
Baris 91 ⟶ 88:
In contrast, an ''untyped language'', such as most [[assembly language]]s, allows any operation to be performed on any data, which are generally considered to be sequences of bits of various lengths.<ref name="typing"/> High-level languages which are untyped include [[BCPL]] and some varieties of [[Forth (programming language)|Forth]].
In practice, while few languages are considered typed from the point of view of [[type theory]] (verifying or rejecting ''all'' operations), most modern languages offer a degree of typing.<ref name="typing"/> Many production languages provide
==== Static versus dynamic typing ====
In ''[[static typing]]'' all expressions have their types determined prior to the program being run (typically at compile-time). For example, 1 and (2+2) are integer expressions; they cannot be passed to a function that expects a string, or stored in a variable that is defined to hold dates.<ref name="typing"/>
Statically-typed languages can be ''manifestly typed'' or ''[[type inference|type-inferred]]''. In the first case, the programmer must explicitly write types at certain textual positions (for example, at variable [[declaration (computer science)|declarations]]). In the second case, the compiler ''infers'' the types of expressions and declarations based on context. Most
''Dynamic typing'', also called ''latent typing'', determines the type-safety of operations at runtime; in other words, types are associated with ''runtime values'' rather than ''textual expressions''.<ref name="typing"/> As with type-inferred languages, dynamically typed languages do not require the programmer to write explicit type annotations on expressions. Among other things, this may permit a single variable to refer to values of different types at different points in the program execution. However, type errors cannot be automatically detected until a piece of code is actually executed, making debugging more difficult. [[Ruby (programming language)|Ruby]], [[Lisp programming language|Lisp]], [[JavaScript]], and [[Python (programming language)|Python]] are dynamically typed.
==== Weak and strong typing ====
''Weak typing'' allows a value of one type to be
''Strong typing'' prevents the above. Attempting to mix types raises an error.<ref name="typing"/> Strongly-typed languages are often termed ''type-safe'' or ''[[type safety|safe]]''. Type safety can prevent particular kinds of program faults occurring (because constructs containing them are flagged at compile time).
An alternative definition for "weakly typed" refers to languages, such as [[Perl]], [[JavaScript]], and [[C++]] which permit a large number of implicit type conversions; Perl in particular can be characterized as a dynamically typed programming language in which type checking can take place at runtime. See [[type system]]. This capability is often useful, but occasionally dangerous; as it would permit operations whose objects can change type on demand.
''Strong'' and ''static'' are generally considered orthogonal concepts, but usage in the literature differs. Some use the term ''strongly typed'' to
=== Execution semantics ===
Baris 118 ⟶ 115:
Most programming languages have an associated [[library (computer science)|core library]] (sometimes known as the 'Standard library', especially if it is included as part of the published language standard), which is conventionally made available by all implementations of the language. Core libraries typically include definitions for commonly used algorithms, data structures, and mechanisms for input and output.
A language's core library is often
== Practice ==
Baris 137 ⟶ 134:
| publisher = MIT Press
| year = 1997
| id = ISBN 0-262-63181-4 }}</ref> and [[Scheme (programming language)|Scheme]]<ref>{{cite web|first=Richard |last=Kelsey|coauthors=William Clinger and Jonathan Rees|title=Section 7.2 Formal semantics|work=Revised<sup>5</sup> Report on the Algorithmic Language Scheme|url = http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-10.html#%_sec_7.2| year=1998|month=February|accessdate=2006-06-09}}</ref> specifications).
* A description of the behavior of a [[compiler|translator]] for the language (e.g., the [[C++]] and [[Fortran]] specifications). The syntax and semantics of the language have to be inferred from this description, which may be written in natural or a formal language.
* A ''reference'' or ''model'' implementation, sometimes written in the language being specified (e.g., [[Prolog]] or [[Rexx|ANSI REXX]]<ref>[[ANSI]] — Programming Language Rexx, X3-274.1996</ref>). The syntax and semantics of the language are explicit in the behavior of the reference implementation.
Baris 145 ⟶ 142:
An '''implementation''' of a programming language provides a way to execute that program on one or more configurations of hardware and software. There are, broadly, two approaches to programming language implementation: ''[[compiler|compilation]]'' and ''[[interpreter (computing)|interpretation]]''. It is generally possible to implement a language using either technique.
The output of a [[compiler]] may be executed by hardware or a program called an interpreter. In some implementations that
Programs that are executed directly on the hardware usually run several orders of magnitude faster than those that are interpreted in software.
Baris 170 ⟶ 167:
}}</ref>
In the 1940s, the first electrically powered digital computers were
| url=http://www.oreilly.com/news/graphics/prog_lang_poster.pdf
| type=pdf
Baris 177 ⟶ 174:
| accessdate=October 5
| accessyear=2006
}}</ref> At the end of the 1950s, the language formalized as [[Algol 60]] was introduced, and most later programming languages are, in many respects, descendants of Algol.<ref name="influences"/> The format and use of the
<ref>Frank da Cruz. [http://www.columbia.edu/acis/history/cards.html IBM Punch Cards] [http://www.columbia.edu/acis/history/index.html Columbia University Computing History].</ref>
=== Refinement ===
The period from the 1960s to the late 1970s brought the development of the major language paradigms now in use, though many aspects were refinements of
* [[APL (programming language)|APL]] introduced ''[[array programming]]'' and influenced [[functional programming]].<ref>Richard L. Wexelblat: ''History of Programming Languages'', Academic Press, 1981, chapter XIV.</ref>
* [[PL/I]] (NPL) was designed in the
* In the 1960s, [[Simula programming language|Simula]] was the first language designed to support ''[[object-oriented programming]]''; in the mid-1970s, [[Smalltalk programming language|Smalltalk]] followed with the first "purely" object-oriented language.
* [[C (programming language)|C]] was developed between 1969 and 1973 as a ''[[systems programming]]'' language, and remains popular.<ref>{{cite web | url=http://www.cs.berkeley.edu/~flab/languages.html | author=François Labelle | title=Programming Language Usage Graph | work=[[Sourceforge]] | accessdate=June 21 | accessyear=2006}}. This comparison analyzes trends in number of projects hosted by a popular community programming repository. During most years of the comparison, C leads by a considerable margin; in 2006, Java overtakes C, but the combination of C/C++ still leads considerably.</ref>
* [[Prolog programming language|Prolog]], designed in 1972, was the first ''[[logic programming]]'' language.
* In 1978, [[ML programming language|ML]] built a polymorphic type system on top of Lisp, pioneering ''[[static typing|statically typed]] [[functional programming]]'' languages.
The 1960s and 1970s also saw considerable debate over the merits of ''[[structured programming]]'', and whether programming languages should be designed to support it.
The 1960s and 1970s also saw expansion of techniques that reduced the footprint of a program as well as improved productivity of the programmer and user. The [[Computer programming in the punch card era|card deck]] for an
=== Consolidation and growth ===
The 1980s were
Tetsuro Fujise, Takashi Chikayama
Kazuaki Rokusawa, Akihiko Nakase (December 1994). "KLIC: A Portable Implementation of KL1" ''Proc. of FGCS '94, ICOT'' Tokyo, December 1994. [http://www.icot.or.jp/ARCHIVE/HomePage-E.html KLIC is a portable implementation of a concurrent logic programming language [[KL1]].]</ref>. The functional languages community moved to standardize ML and Lisp. Rather than inventing new paradigms, all of these movements elaborated upon the
One important trend in language design during the 1980s was an
The rapid growth of the [[Internet]] in the mid-1990's
Programming language evolution continues, in both industry and
The [[4GL]]s are examples of languages which are domain-specific, such as [[SQL]], which manipulates and returns [[set]]s of data rather than the scalar values which are canonical to most programming languages. [[Perl]], for example, with its '[[here document]]' can hold multiple 4GL programs, as well as multiple JavaScript programs, in part of its own perl code and use variable interpolation in the 'here document' to support multi-language programming<ref>Wall, ''Programming Perl'' ISBN 0-596-00027-8 p.66</ref>.
=== Measuring language usage ===
It is difficult to determine which programming languages are most widely used, and what usage
Various methods of
* counting the number of job advertisements that mention the language<ref>[http://www.computerweekly.com/Articles/2007/09/11/226631/sslcomputer-weekly-it-salary-survey-finance-boom-drives-it-job.htm Survey of Job advertisements mentioning a given language]</ref>
* the number of books sold that
* estimates of the number of existing lines of code written in the language—which may underestimate languages not often found in public
* counts of language references found using a web
== Taxonomies ==
{{details|Categorical list of programming languages}}
There is no overarching classification scheme for programming languages. A given programming language does not usually have a single ancestor language. Languages commonly arise by combining the elements of several predecessor languages with new
The task is further complicated by the fact that languages can be classified along multiple axes. For example, Java is both an object-oriented language (because it encourages object-oriented organization) and a concurrent language (because it contains built-in constructs for running multiple [[Thread (computer science)|threads]] in parallel). [[Python (programming language)|Python]] is an object-oriented [[scripting language]].
In broad strokes, programming languages divide into ''[[programming paradigm]]s'' and a classification by ''intended domain of use''. Paradigms include [[procedural programming]], [[object-oriented programming]], [[functional programming]], and [[logic programming]]; some languages are hybrids of paradigms or multi-paradigmatic. An [[assembly language]] is not so much a paradigm as a direct model of an underlying machine architecture. By purpose, programming languages might be considered general purpose, system programming languages, scripting languages, domain-specific languages, or concurrent/distributed languages (or a combination of these).<ref>{{cite web|url=http://tunes.org/wiki/programming_20languages.html|title=TUNES: Programming Languages}}</ref> Some general purpose languages were designed largely with educational goals.
A programming language may also be classified by factors unrelated to programming paradigm. For instance, most programming languages use [[English language]] keywords, while a [[Categorical list of programming languages#Non-English-based languages|minority do not]]. Other languages may be classified as being [[Esoteric programming language|esoteric]] or not.
|