rui314 / 8cc

A Small C Compiler
MIT License
6.13k stars 740 forks source link

VM #52

Closed mkschreder closed 9 years ago

mkschreder commented 9 years ago

What would be really cool is if you wrote a vm module for it and have it generate vm code. That would make it easier to use as a portable C script vm. :-)

andrewchambers commented 9 years ago

There are many other things to be done on 8cc before this is worth looking at, but you are welcome to implement it yourself.

You should see the quake engine which used lcc and a vm for its scripting language. I don't think this is a good use for 8cc tbh.

rui314 commented 9 years ago

Writing a VM is easier than writing a compiler for native instructions because you have control of both compilers and machines. You can define a virtual machine to which you can easily compile your code. I don't plan to add that because I'm not particularly interested in, though. So, well, this would be a good exercise for the reader. :)