Computer program: Difference between revisions

Content deleted Content added
The discussion is giving me a headache
No edit summary
Tags: Reverted Visual edit Mobile edit Mobile web edit
Line 1:
{{Short description|Instructions a computer can execute}}
[[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.]][[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
{{for|the TV program|The Computer Programme{{!}}''The Computer Programme''}}
[[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 16 ⟶ 12:
}}</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 27 ⟶ 23:
}}</ref>
 
If the executable is requested for execution, then the [[operating system]] [[Loader (computing)|loads]] it into [[Random-access memory|memory]] and starts a [[Process (computing)|process]].<ref name="osc-ch4-p98">{{cite book
| last = Silberschatz
| first = Abraham
Line 35 ⟶ 31:
| page = 98
| isbn = 978-0-201-50480-4
}}</ref> The [[central processing unit]] will soon [[Context switch|switch]] to this process so it can [[Instruction cycle|fetch, decode, and then execute]] each machine instruction.<ref name="sco-ch2-p32">{{cite book
| last = Tanenbaum
| first = Andrew S.