Content deleted Content added
mNo edit summary |
TakuyaMurata (talk | contribs) sum -> product; geez; add some |
||
Line 1:
In [[computer science]], a '''stack-based language''' is a [[computer language]] that uses the [[stack (computing)|stack]] to store intermediate results during computation. [[Forth]] and [[Java programming language|Java]]'s [[byte-code]] are examples of stack-based languages.
A stack-based language tends to be used as intermediate representation of a program during its compilation.
Advantages of the stack-based languages over others include:
* An interpreter or compiler for the language tends to be small and simple.
The disadvantages include:
* It may be more tricky to optimize code.
== Example ==
Line 12 ⟶ 18:
push 30 // push 30
add // pop two values from the stack, and push its sum
mul // pop two values from the stack, and push its
</pre>
|