Hacker News new | ask | show | jobs
by bsaul 1999 days ago
You compile C to « js ». Then pdf readers being able to execute js, you can basically execute C.
1 comments

If you have an eval function or some kind of API to start that execution.
Eval() is part of the js language so you obviously do. But regardless you could make your own interpreter if neccessary. You could compile to x86 and then run it in your own VM if you felt like it.
Or run your own JavaScript interpreter, of course nesting interpreters that way is going to be horribly slow.
I mean, despite all the weirdness, it's all still run by Chrome's V8 in the end, so it might work...