Primary reasons why programming language runtimes use stacks?

Posted by manuel aldana on Stack Overflow See other posts from Stack Overflow or by manuel aldana
Published on 2011-01-16T17:51:38Z Indexed on 2011/01/16 17:53 UTC
Read the original article Hit count: 247

Many programming language runtime environments use stacks as their primary storage structure (e.g. see JVM bytecode to runtime example).

Quickly recalling I see following advantages:

  • Simple structure (pop/push), trivial to implement
  • Most processors are anyway optimized for stack operations, so it is very fast
  • Less problems with memory fragmentation, it is always about moving memory-pointer up and down for allocation and freeing complete blocks of memory by resetting the pointer to the last entry offset.

Is the list complete or did I miss something? Are there programming language runtime environments which are not using stacks for storage at all?

© Stack Overflow or respective owner

Related posts about java

Related posts about language-agnostic