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
Stack-oriented programming
(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|Programming paradigm that relies on a stack machine model}} {{redirects here|Stack-based|other uses|Stack-based memory allocation}} {{multiple issues|{{Refimprove|date=December 2009}} {{Rewrite lead|reason=Reflect the new title without "language"|date=June 2018}} {{tone|date=March 2019}}}} '''Stack-oriented programming''' is a [[programming paradigm]] that relies on one or more [[stack machine|stacks]] to manipulate [[data]] and/or pass parameters. Programming constructs in other programming languages need to be modified for use in a stack-oriented system.<ref>Luerweg, T. (2015). Stack based programming paradigms. Concepts of Programming Languages–CoPL’15, 33.</ref> Most stack-oriented languages operate in ''postfix'' or [[Reverse Polish notation]]: arguments or parameters for a command are listed before that command. For example, postfix notation would be written {{nowrap|<code>2, 3, multiply</code>}} instead of {{nowrap|<code>multiply, 2, 3</code>}} (''prefix'' or [[Polish notation]]), or {{nowrap|<code>2 multiply 3</code>}} ([[infix notation|''infix'' notation]]). The programming languages [[Forth (programming language)|Forth]], [[Factor (programming language)|Factor]], [[RPL (programming language)|RPL]], [[PostScript]], [[BibTeX]] style design language<ref>{{citation|author=Oren Patashnik |title=Designing BibTeX styles |url=http://www.ctan.org/tex-archive/info/biblio/bibtex/contrib/doc/btxhak.pdf}}{{dead link|date=April 2019}}</ref> and many [[assembly language]]s fit this paradigm. Stack-based algorithms manipulate data by popping data from and pushing data to the stack. Operators govern how the stack manipulates [[data]]. To emphasize the effect of a statement, a comment is often used showing the top of the stack before and after the statement; this is known as the stack effect diagram. Some stack-oriented languages may use multiple stacks for different purposes; for example, PostScript uses separate stacks for variables, dictionaries, procedures, some typical procedures, and control flow statements. Analysis of the [[language model]] allows expressions and programs to be interpreted simply.
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)