[virtmach] bytecodes and stacks

Ceri Storey cez@nomorespam.freeserve.co.uk
Sun, 28 Nov 1999 21:17:13 +0000

One day, i was bored, and thought it would be fun to implement a bytecoded 
virtual machine, sort of like the one in emacs, exept the code being 
compiled is something like scheme, and functionalally biased (as opposed to 
 I have a small amount of code, for the actual opcodes, but i am having a 
few problems with how to reperesent storage. i was thinking, that a stack 
would be an idea, where each place on the stack can hold any kind of object
(number, string, list of objects). 

The questions are:
Is it possible to just push/pop things off one stack, allowing for things 
like global-variables and locally bound ones (eg. let in scheme)? or would 
several be needed, leading to a towers of hanoi like situation, when you 
needed  to reference a variable form an earlier "stack frame", not a fun 

i hope i'm not wasting your time, and thanks in advance.
-----------| Ceri Storey
   _\|/_   | http://cez.freeshell.org/
  o(O O)o  |    {for geek code also}
_o0O(_)O0o_| cez@nomorespam.freeserve.co.uk