== Execution modes ==
{{refimprove section|find=Execution modes|date=October 2018}}
The source code of a high-level language may be processed in various ways, including
There are three general modes of execution for modern high-level languages:
; Interpreted: When code written in a language is [[Interpreted language|interpreted]], its syntax is read and then executed directly, with no compilation stage. A program called an ''interpreter'' reads each program statement, following the program flow, then decides what to do, and does it. A hybrid of an interpreter and a compiler will compile the statement into machine code and execute that; the machine code is then discarded, to be interpreted anew if the line is executed again. Interpreters are commonly the simplest implementations of the behavior of a language, compared to the other two variants listed here.
; Compiled: When code written in a language is [[Compiled language|compiled]], its syntax is transformed into an executable form before running. There are two types of compilation:
:; Machine code generation: Some compilers compile source code directly into [[machine code]]. This is the original mode of compilation, and languages that are directly and completely transformed to machine-native code in this way may be called ''truly compiled'' languages. See [[assembly language]].
:; Intermediate representations: When code written in a language is compiled to an [[intermediate representation]], that representation can be optimized or saved for later execution without the need to re-read the source file. When the intermediate representation is saved, it may be in a form such as [[bytecode]]. The intermediate representation must then be interpreted or further compiled to execute it. [[Virtual machine]]s that execute bytecode directly or transform it further into machine code have blurred the once clear distinction between intermediate representations and truly compiled languages.
; Source-to-source translated or transcompiled: Code written in a language may be translated into terms of a lower-level language for which native code compilers are already common. [[JavaScript]] and the language [[C (programming language)|C]] are common targets for such translators. See [[CoffeeScript]], [[Chicken (Scheme implementation)|Chicken]] Scheme, and [[Eiffel (programming language)|Eiffel]] as examples. Specifically, the generated C and C++ code can be seen (as generated from the Eiffel language when using the [[EiffelStudio]] IDE) in the EIFGENs directory of any compiled Eiffel project. In Eiffel, the ''translated'' process is referred to as transcompiling or transcompiled, and the Eiffel compiler as a transcompiler or [[source-to-source compiler]]. ▼
; Compiled: A [[compiler]] transforms source code into other code. Sometimes, and traditionally, a compiler generates native machine code that is interpreted by the processor. But, today many execution models involve generating an [[intermediate representation]] (i.e. [[bytecode]]) that is later interpreted in software or converted to native code at runtime (via [[JIT compilation]]).
Note that languages are not strictly ''interpreted'' languages or ''compiled'' languages. Rather, implementations of language behavior use interpreting or compiling. For example, [[ALGOL 60]] and [[Fortran]] have both been interpreted (even though they were more typically compiled). Similarly, Java shows the difficulty of trying to apply these labels to languages, rather than to implementations; Java is compiled to bytecode which is then executed by either interpreting (in a [[Java virtual machine]] (JVM)) or compiling (typically with a just-in-time compiler such as [[HotSpot (virtual machine)|HotSpot]], again in a JVM). Moreover, compiling, transcompiling, and interpreting is not strictly limited to only a description of the compiler artifact (binary executable or IL assembly). ▼
▲; Source-to-source translated or transcompiled[[Transpiled]]: Code written in a language may be translated into termssource code of aanother language (typically lower-level language) for which nativea codecompiler compilersor areinterpreter alreadyis commonavailable. [[JavaScript]] and the language [[C (programming language)|C]] are common targets for such translators. SeeFor [[CoffeeScript]]example, [[Chicken (Scheme implementation)|Chicken]] Scheme, and [[Eiffel (programming language)|Eiffel]] as examples. Specifically, the generated C and C++ code can be seen (as generated from the Eiffel languagecode when using the [[EiffelStudio]] IDE ) in the EIFGENs directory of any compiled Eiffel project. In Eiffel, the ''translated'' process is referred to as ''transcompiling '' or ''transcompiled '', and the Eiffel compiler as a transcompiler or [[source-to-source compiler]].
=== High-level language computer architecture ===
A [[high-level language computer architecture]] refers to processor hardware designed to directly interpret high-level language source code. The [[Burroughs large systems]] were target machines for [[ALGOL 60]], for example.<ref>{{Citation|last=Chu|first=Yaohan|chapter=Concepts of High-Level Language Computer Architecture|date=1975|pages=1–14|publisher=Elsevier|isbn=9780121741501|doi=10.1016/b978-0-12-174150-1.50007-0|title=High-Level Language Computer Architecture}}</ref> ▼
; Software interpreted: A [[interpreter (software)|software interpreter]] performs the actions encoded in source code without generating native machine code.
▲A; Hardware interpreted: Although uncommon, a processor with a [[high-level language computer architecture]] referscan toprocess processor hardware designed to directly interpreta high-level language sourcewithout codea compilation step. TheFor example, the [[Burroughs large systems]] were target machines for [[ALGOL 60]] , for example.<ref>{{Citation|last=Chu|first=Yaohan|chapter=Concepts of High-Level Language Computer Architecture|date=1975|pages=1–14|publisher=Elsevier|isbn=9780121741501|doi=10.1016/b978-0-12-174150-1.50007-0|title=High-Level Language Computer Architecture}}</ref>
▲Note that languagesa arelanguage is not strictly ''interpreted '' languages or ''compiled '' languages. Rather, implementationsan ofexecution languagemodel behaviorinvolves usea interpretingcompiler or compilingan interpreter and the same language might be used with different execution models. For example, [[ALGOL 60]] and [[Fortran]] have both been interpreted (even though they were more typically compiled ). Similarly, Java shows the difficulty of trying to apply these labels to languages, rather than to implementations ;. Java is compiled to bytecode which is then executed by either interpreting (in a [[Java virtual machine]] (JVM )) or compilingJIT (typically with a just-in-time compiler such as [[HotSpot (virtual machine)|HotSpot]], again in a JVM). Moreover, compiling, transcompiling, and interpreting is not strictly limited to only a description of the compiler artifact (binary executable or IL assembly)compiled.
== See also ==
|