You'd need to write an entire hardware abstraction layer to do anything useful. There's projects that do this for microcontrollers - eg MicroPython and Espruino.

Should be able to do similar with MicroQuickJS or maybe just QuickJS...