Register-based VMs have a higher performance than stack-based VMs
I would love to see the code used for some of these instructions. Their description of &quot;swap&quot; for the stack VM jumped out at me:<p>&gt; pop 1 st and 2nd value out of local stack and swap them<p>You don&#x27;t need to pop <i>at all</i> for swap. The stack isn&#x27;t actually changing size and can be modified in place. You also should only have one pop for &#x27;add&#x27;, etc. A lot of people don&#x27;t seem to realise this.<p>Also, this article may be of interest:<p><a href="https:&#x2F;&#x2F;blogs.msdn.microsoft.com&#x2F;ericlippert&#x2F;2011&#x2F;11&#x2F;28&#x2F;why-have-a-stack&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blogs.msdn.microsoft.com&#x2F;ericlippert&#x2F;2011&#x2F;11&#x2F;28&#x2F;why-...</a><p>TL;DR - a stack machine is conceptually simpler than a register machine, and it doesn&#x27;t matter if it&#x27;s slower since you are JIT&#x27;ing it anyway.