Content deleted Content added
[1] Tags: Reverted references removed Visual edit Mobile edit Mobile web edit |
m Reverted edit by 2400:9800:4F8:6D1:3085:D40E:B86A:CE39 (talk) to last version by Kvng |
||
Line 3:
[[File:JavaScript_code.png|thumb|[[Source code]] for a computer program written in the [[JavaScript]] language. It demonstrates the ''appendChild'' method. The method adds a new child node to an existing parent node. It is commonly used to dynamically modify the structure of an HTML document.]]
{{Program execution}}
A '''computer program''' is a [[sequence]] or set{{efn|The [[Prolog]] language allows for a database of facts and rules to be entered in any order. However, a question about a database must be at the very end.}} of instructions in a [[programming language]] for a [[computer]] to [[Execution (computing)|execute]]. It is one component of [[software]], which also includes [[software documentation|documentation]] and other intangible components.<ref name="ISO 2020">{{cite web
| title=ISO/IEC 2382:2015
| website=ISO
Line 15:
}}</ref>
A ''computer program'' in its [[human-readable]] form is called [[source code]]. Source code needs another computer program to [[Execution (computing)|execute]] because computers can only execute their native [[machine instructions]]. Therefore, source code may be [[Translator (computing)|translated]] to machine instructions using a [[compiler]] written for the language. ([[Assembly language]] programs are translated using an [[Assembler (computing)|assembler]].) The resulting file is called an [[executable]]. Alternatively, source code may execute within an [[interpreter (computing)|interpreter]] written for the language.<ref name="cpl_3rd-ch1-7_quoted">{{cite book
| last = Wilson
| first = Leslie B.
Line 45:
}}</ref>
If the source code is requested for execution, then the operating system loads the corresponding interpreter into memory and starts a process. The interpreter then loads the source code into memory to translate and execute each [[Statement (computer science)|statement]]. Running the source code is slower than running an
| first = Leslie B.
| title = Comparative Programming Languages, Third Edition
| publisher = Addison-Wesley
| year = 2001
| page = 7
| isbn = 0-201-71012-9
}}</ref>{{efn|An executable has each [[machine instruction]] ready for the [[CPU]].}} Moreover, the interpreter must be installed on the computer.
==Example computer program==
|