Skip to content

Commit

Permalink
link stack frames post from series header and footer
Browse files Browse the repository at this point in the history
  • Loading branch information
igorw committed Dec 11, 2014
1 parent 64cb1ea commit 51e6609
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 18 deletions.
6 changes: 4 additions & 2 deletions _posts/2013-08-28-stack-machines-fundamentals.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

This series will explore design and implementation of virtual stack machines.
That is, virtual machines whose operations are based on a stack. This post
Expand Down Expand Up @@ -117,4 +118,5 @@ popped from the stack and returned.
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2013-12-02-stack-machines-rpn.md
Expand Up @@ -29,7 +29,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

A very simple form of stack machine is a so-called RPN calculator. It is quite
easy to understand and implement, and uses the same model that is used by most
Expand Down Expand Up @@ -211,4 +212,5 @@ power. It is comparable to a pushdown automaton.
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2013-12-03-stack-machines-shunting-yard.md
Expand Up @@ -23,7 +23,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

The RPN calculator (see previous post) was quite easy to implement, but in
order to use it, everything must be written backwards. Re-gaining infix
Expand Down Expand Up @@ -304,4 +305,5 @@ entry to `$operators` and an implementation to the `switch` statement in
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2014-11-29-stack-machines-io.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

The RPN calculator (see [previous post](/2013/12/02/stack-machines-rpn.html)) allows you to evaluate arithmetical expressions. Once the end of the instruction stream is reached, the top of the stack is returned.

Expand Down Expand Up @@ -103,4 +104,5 @@ This is left as an exercise to the reader.
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2014-11-30-stack-machines-jumps.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

<code>label(start)</code>

Expand Down Expand Up @@ -235,7 +236,8 @@ Conditional branching will change everything once again, but for now let us enjo
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

---

Expand Down
6 changes: 4 additions & 2 deletions _posts/2014-12-01-stack-machines-conditionals.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[**conditionals**](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

In previous posts, we have seen that stack machines can be extended with I/O and unconditional jumps to create infinite loops. However, it is not possible to break out of those loops. What a vicious cycle indeed.

Expand Down Expand Up @@ -149,4 +150,5 @@ The conditional jump goes to infinity, but only sometimes. This makes programs u
[**conditionals**](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2014-12-02-stack-machines-comments.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[**comments**](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

Most extensions to la deus stack machina so far have been to the execution engine. But there are also some improvements that can be made to the parser.

Expand Down Expand Up @@ -88,4 +89,5 @@ $ops = preg_split('/\s/', preg_replace('/^\s*#.*$/m', '', $code), -1, PREG_SPLIT
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[**comments**](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2014-12-03-stack-machines-calls.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[**calls**](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

> Hey I just met you<br />
> And this is crazy<br />
Expand Down Expand Up @@ -150,4 +151,5 @@ switch ($op) {
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[**calls**](/2014/12/03/stack-machines-calls.html) <<
[variables](/2014/12/04/stack-machines-variables.html)
[variables](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)
6 changes: 4 additions & 2 deletions _posts/2014-12-04-stack-machines-variables.md
Expand Up @@ -14,7 +14,8 @@ tags: []
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[**variables**](/2014/12/04/stack-machines-variables.html)
[**variables**](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

The virtual machine that has been implemented so far is limited in storage, because the only data structure is a stack. While the stack can grow infinitely large, it is only possible to access the top element. There is no way to index into it.

Expand Down Expand Up @@ -180,4 +181,5 @@ However, if the machine in question does not support calls, then everything is g
[conditionals](/2014/12/01/stack-machines-conditionals.html) <<
[comments](/2014/12/02/stack-machines-comments.html) <<
[calls](/2014/12/03/stack-machines-calls.html) <<
[**variables**](/2014/12/04/stack-machines-variables.html)
[**variables**](/2014/12/04/stack-machines-variables.html) <<
[stack-frames](/2014/12/05/stack-machines-stack-frames.html)

0 comments on commit 51e6609

Please sign in to comment.