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
Abstract machine
(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!
== Programming language implementation == An abstract machine is, intuitively, just an [[Abstraction (computer science)|abstraction]] of the idea of a physical computer.<ref>{{Cite web |title=abstract machine |url=https://www.oxfordreference.com/view/10.1093/oi/authority.20110803095345129 |access-date=2022-05-16 |website=Oxford Reference |language=en}}</ref> For actual execution, [[algorithm]]s must be properly formalised using the constructs offered by a [[programming language]]. This implies that the algorithms to be executed must be expressed using programming language instructions.<ref name=":1" /> The [[Syntax (programming languages)|syntax of a programming language]] enables the construction of [[Computer program|programs]] using a finite set of constructs known as instructions. Most abstract machines share [[Stored-program computer|a program store]] and [[State (computer science)|a state]], which often includes [[Stack (abstract data type)|a stack]] and registers.<ref name=":3" /><ref>{{Cite conference |last1=García-Martín |first1=Julio Manuel |last2=Sutil-Martin |first2=Miguel |date=August 15, 1999 |contribution=The Abstract Machine: A Pattern for Designing Abstract Machines |contribution-url=https://hillside.net/plop/plop99/proceedings/garcia/garcia.pdf|title=Proceedings of Pattern Languages of Programs '99}}</ref> In digital computers, the stack is simply a [[Memory cell (computing)|memory unit]] with an address register that can count only positive integers (after an initial value is loaded into it). The address register for the stack is known as [[Program counter|a stack pointer]] because its value always refers to the top item on the stack.<ref>{{Cite web |last=upscfever.com |date=2017-01-25 |title=Computer Organization and Architecture (Stack Organization) - UPSC FEVER |url=http://upscfever.com/upsc-fever/en/gatecse/en-gatecse-chp159.html |access-date=2022-05-31 |website=upscfever.com |language=en}}</ref> The program consists of a series of instructions, with [[Program counter|a stack pointer]] indicating the next instruction to be performed. When the instruction is completed, [[Program counter|a stack pointer]] is advanced. This fundamental control mechanism of an abstract machine is also known as its [[Execution (computing)|execution loop]].<ref name=":1" /> Thus, an abstract machine for a programming language is any collection of [[data structure]]s and algorithms capable of storing and running programs written in the programming language. It bridges the gap between the [[High-level programming language|high level of a programming language]] and the [[Low-level programming language|low level of an actual machine]] by providing an intermediate language step for [[Compiler|compilation]]. An abstract machine's instructions are adapted to the unique operations necessary to implement operations of a certain source language or set of source languages.<ref name=":3" /> === Imperative languages === In the late 1950s, the [[Association for Computing Machinery|Association for Computing Machinery (ACM)]] and other allied organisations developed many proposals for [[UNCOL|Universal Computer Oriented Language (UNCOL)]], such as [[Conway's Game of Life|Conway's machine]]. The UNCOL concept is good, but it has not been widely used due to the poor performance of the generated [[code]]. In many areas of computing, its performance will continue to be an issue despite the development of the [[Java virtual machine|Java Virtual Machine]] in the late 1990s. [[ALGOL|Algol Object Code]] (1964), P4-machine (1976), [[UCSD Pascal|UCSD P-machine]] (1977), and [[Forth (programming language)|Forth]] (1970) are some successful abstract machines of this kind.<ref name=":1" /> === Object-oriented languages === Abstract machines for [[Object-oriented programming|object-oriented programming languages]] are often [[Stack-based memory allocation|stack-based]] and have special access instructions for [[Object (computer science)|object fields]] and [[Method (computer programming)|methods]]. In these machines, [[memory management]] is often implicit performed by a [[Garbage collection (computer science)|garbage collector]] (memory recovery feature built into programming languages).<ref>{{Cite web |title=What is Object-Oriented Programming (OOP)? |url=https://www.techtarget.com/searchapparchitecture/definition/object-oriented-programming-OOP |access-date=2022-05-31 |website=SearchAppArchitecture |language=en}}</ref> [[Smalltalk|Smalltalk-80]] (1980), [[Self (programming language)|Self]] (1989), and [[Java (programming language)|Java]] (1994) are examples of this implementation.<ref name=":1" /> === String processing languages === A [[String (computer science)|string processing language]] is a computer language that focuses on processing strings rather than numbers. There have been string processing languages in the form of [[Shell (computing)|command shells]], [[Programming tool|programming tools]], [[General-purpose macro processor|macro processors]], and [[Scripting language|scripting languages]] for decades.<ref>{{Citation |title=Design considerations for string processing languages |date=1985 |url=http://dx.doi.org/10.1007/3-540-16041-8_2 |work=A Study in String Processing Languages |series=Lecture Notes in Computer Science |volume=205 |pages=17–37 |place=Berlin, Heidelberg |publisher=Springer Berlin Heidelberg |doi=10.1007/3-540-16041-8_2 |isbn=978-3-540-16041-0 |access-date=2022-05-31}}</ref> Using a suitable abstract machine has two benefits: increased [[Execution (computing)|execution speed]] and enhanced portability. [[SNOBOL|Snobol4]] and [[ML/I]] are two notable instances of early string processing languages that use an abstract machine to gain machine independence.<ref name=":1" /> === Functional programming languages === [[File:Machine de Krivine.jpg|thumb|Pictorial representation of a [[Krivine machine]]]]The early abstract machines for [[Functional programming|functional languages]], including the [[SECD machine]] (1964) and Cardelli's Functional Abstract Machine (1983), defined strict evaluation, also known as [[Evaluation strategy|eager or call-by-value evaluation]],<ref name=":1" /> in which function arguments are evaluated before the call and precisely once. Recently, the majority of research has been on [[Lazy evaluation|lazy (or call-by-need) evaluation]],<ref>{{Cite journal |last1=Hackett |first1=Jennifer |last2=Hutton |first2=Graham |date=2019-07-26 |title=Call-by-need is clairvoyant call-by-value |journal=Proceedings of the ACM on Programming Languages |volume=3 |issue=ICFP |pages=1–23 |doi=10.1145/3341718 |s2cid=195782686 |issn=2475-1421|doi-access=free }}</ref> such as the G-machine (1984), [[Krivine machine]] (1985), and Three Instruction Machine (1986), in which function arguments are evaluated only if necessary and at most once. One reason is because effective implementation of strict evaluation is now well-understood, therefore the necessity for an abstract machine has diminished.<ref name=":1" /> === Logical languages === [[First-order logic|Predicate calculus (first order logic)]] is the foundation of [[Logic programming|logic programming languages]]. The most well-known logic programming language is [[Prolog]]. The rules in Prolog are written in a uniform format known as universally quantified 'Horn clauses', which means to begin the calculation that attempts to discover a proof of the objective. The [[Warren Abstract Machine|Warren Abstract Machine WAM]] (1983),<ref name=":1" /> which has become the de facto standard in Prolog program compilation, has been the focus of most study. It provides special purpose instructions such as data unification instructions and control flow instructions to support backtracking (searching algorithm).<ref>{{Cite web |date=2018-05-26 |title=Prolog {{!}} An Introduction |url=https://www.geeksforgeeks.org/prolog-an-introduction/ |access-date=2022-05-31 |website=GeeksforGeeks |language=en-us}}</ref>
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)