Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Computer program
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Instructions a computer can execute}} {{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 | date=2020-09-03 | url=https://www.iso.org/obp/ui/#iso:std:iso-iec:2382:ed-1:v1:en | access-date=2022-05-26 | quote=[Software includes] all or part of the programs, procedures, rules, and associated documentation of an information processing system. | archive-date=2016-06-17 | archive-url=https://web.archive.org/web/20160617031837/https://www.iso.org/obp/ui/#iso:std:iso-iec:2382:ed-1:v1:en | url-status=live }}</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. | title = Comparative Programming Languages, Third Edition | publisher = Addison-Wesley | year = 2001 | page = 7 | quote = An alternative to compiling a source program is to use an interpreter. An interpreter can directly execute a source program[.] | isbn = 0-201-71012-9 }}</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 | title = Operating System Concepts, Fourth Edition | publisher = Addison-Wesley | year = 1994 | 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. | title = Structured Computer Organization, Third Edition | publisher = Prentice Hall | year = 1990 | page = [https://archive.org/details/structuredcomput00tane/page/32 32] | isbn = 978-0-13-854662-5 | url = https://archive.org/details/structuredcomput00tane/page/32 }}</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 [[executable]].<ref name="cpl_3rd-ch1-7">{{cite book | last = Wilson | 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)