GitHub - ading2210/doompdf: A port of Doom (1993) that runs inside a PDF file
C code can be compiled to run within a PDF using and old version of Emscripten that targets asm.js instead of WebAssembly. Then, all that's needed is a way to get key inputs, and a framebuffer for the output. Inputs are fairly straightforward, since Chromium's PDF engine supports text fields and buttons. Getting a good looking and fast enough framebuffer is a lot more of a challenge though.
— Permalink