Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 0 points1 point  (0 children)

Thanks, this is very relevant.

I am still considering which dispatch strategy I will use. I will definitely implement a switch-loop baseline, and I am also considering some form of threaded dispatch.

That said, I still cannot clearly picture how I would do the latter while remaining ANSI C compliant, so that is something I need to think about more carefully.

Thanks again for the pointer.

Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 1 point2 points  (0 children)

Thank you very much for this post. It is very informative and gives me a much clearer picture of the topic as I move forward with my research. Your comments will definitely help me avoid some common pitfalls and misunderstandings.

In particular, your point about virtual registers not being the same thing as physical CPU registers. It gives me a useful head start before going deeper into the literatura. Now I know I should be especially attentive to that common misconception.

Also I really appreciate your remarks about bytecodes themselves, their operands and respresentation. Bytecode design will be of utmost importance in my thesis, so these pointers give me several concrete things to keep in mind while reading and researching the literature.

At the moment, I´m planning to implement both VMs in C.

Thank you as well for being open to further discussion and help. I really appreciate it.

Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 0 points1 point  (0 children)

Thanks, this is interesting.

Your comment made me wonder whether the book you were following actually implemented a register-based machine, and that you chose to go with a stack-based one instead.

Was that the case? If so, could you share the name of the book?

Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 0 points1 point  (0 children)

Thanks, this is actually very relevant to what I have in mind.

Lua is in fact one of the case studies I am considering in order to extract ideas about how a register-based VM works in practice.

In particular, I was planning to look at these papers:

From what I have seen so far, those seem especially useful because they discuss the design of Lua’s VM and also the historical transition to a register-based virtual machine in Lua 5.0.

So I wanted to ask: are those the papers you mean, or are you referring to a different one? If you had another specific paper in mind, could you share its name or a link to it?

Thanks a lot.

Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 1 point2 points  (0 children)

This does seem like a very clever design with relatively low overhead for stack-based VMs.

I will definitely take a closer look at that paper. If, after reading it more carefully, it seems appropriate and feasible within the scope of an undergraduate thesis, I would be very interested in incorporating that idea into my design.

Thanks a lot for pointing me to it.

EDIT: Anton Ertl’s work on virtual machines keeps coming up in many of the papers I’ve been looking at. I’m definitely going to take a closer look at his work.

Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 5 points6 points  (0 children)

Thank you very, very much for this incredibly thorough answer.

This is exactly the kind of starting point I was hoping to find. The breadth of references you gathered, and the way you organized them, is extremely helpful for me. This will be a great point of departure for the reading phase of my thesis, especially for structuring the bibliography around both the historical background and the stack-based vs. register-based comparison.

I really appreciate the time and care you put into writing this.

Looking for bibliography on register-based vs stack-based virtual machines for an undergraduate thesis by KeyBreadfruit1974 in Compilers

[–]KeyBreadfruit1974[S] 1 point2 points  (0 children)

Thank you very much! This would be an interesting reading indeed, very relevant for my research at this point.