It would be possible (a bit slow though). This has already been done a few times with JS. For example, qBasic (http://stevehanov.ca/blog/index.php?id=92) or even virtualizing a whole device like the gameboy (http://www.codebase.es/jsgb/).
No comments yet.