This project is nice for educational purposes, but I wouldn't call it a VM, but instead a "bytecode interpreter". I think nowadays it is kind of a minimum requirement to have the intermediate code JIT-compiled (or at least compiled). I'm also missing a garbage collector, although that is not necessarily part of a VM (but often is). See NaCl for a counterexample. By the way, a project that I'd like to see is an effici…
Implementing a Virtual Machine in C
51–54 of 54 posts
Re: Implementing a Virtual Machine in C
#52This project is nice for educational purposes, but I wouldn't call it a VM, but instead a "bytecode interpreter". I think nowadays it is kind of a minimum requirement to have the intermediate code JIT-compiled (or at least compiled). I'm also missing a garbage collector, although that is not necessarily part of a VM (but often is). See NaCl for a counterexample. By the way, a project that I'd like to see is an effici…
Re: Implementing a Virtual Machine in C
#53I find these kinds of very basic intro articles frustrating. They till the same ground over and over: a tiny instruction set implemented with a switch statement. None of the more difficult issues are addressed: exception handling, linking to libraries or other programs written for the same VM, portability of programs across architectures, accessing the OS for services like file I/O, time, etc.-- All the things that m…
https://netspring.wordpress.com/2015/05/10/toy-virtual-machi...
Re: Implementing a Virtual Machine in C
#54The book teaches you to build:
1) A CPU from basic electronics elements
2) An assembler to generate machine code
3) A bytecode VM that can be simulated and an assembler generator from the bytecode
4) A basic programming language that generates bytecode
5) An operating system using that language.
I'm midway through building the Assembler and VM myself :-).