I know how register based and how stack based virtual machines work independently. I know the advantages and disadvantages of both. What I want to know is that has anyone ever tried to merge the two?

I tried to search the net for the existence of such a virtual machine, but to no avail. The best result I got was an article on a hybrid virtual machine (HyVM). If such a virtual machine was indeed created for a programming language, I would be interested in having a look at its source code to understand how it works.

Perhaps someone could point me in the right direction to find such a virtual machine, or link me to an article or blog post that elaborates in this topic.

有帮助吗?

解决方案

Take a look at Forth. It uses a VM, is mainly stack oriented but allows to store values almost in the way you suggest.

In addition, the VM is quite small, so it is easy to explore and to port it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top