4 ms·
I wonder if you could hit this with emscripten and then run it in a browser. There are other CPython's that have been compiled to webasm, but this one might be
by mathgenius 6y ago
I wonder if you could hit this with emscripten and then run it in a browser. There are other CPython's that have been compiled to webasm, but this one might be more light-weight. Maybe?
- stinos 6y agoLooks like some work has been done in that direction: https://github.com/micropython/micropython/issues/888#issuecomment-449637357 https://github.com/micropython/micropython/issues/888#issuec... https://github.com/micropython/micropython/issues/3474 https://github.com/micropython/micropython/issues/3474
- turbinerneiter 6y agoCheck out MicroPython - they already did roughly that, although I don't remember the details.
- jaustin 6y agoYou can with the MicroPython project that this was forked from, but not necessarily with mainline yet, depending on what behaviour you want. https://github.com/micropython/micropython/issues/3474 https://github.com/micropython/micropython/issues/3474 https://github.com/micropython/micropython/issues/888 https://github.com/micropython/micropython/issues/888 There's a nice blog on what Arm did for micro:bit on this: https://community.arm.com/education-hub/b/rob-leeman/posts/building-a-micro-bit-simulator https://community.arm.com/education-hub/b/rob-leeman/posts/b...
- matt_trentini 6y agoMicroPython has a javascript port that uses Emscripten: https://github.com/micropython/micropython/tree/master/ports/javascript https://github.com/micropython/micropython/tree/master/ports... But it doesn't provide much more than the basic REPL. You could also try MicroPython on Unicorn, where more of the hardware is simulated in the browser: http://micropython.org/unicorn/ http://micropython.org/unicorn/ https://github.com/micropython/micropython-unicorn https://github.com/micropython/micropython-unicorn The Unicron-MicroPython kernel is quite old but it's still useful for getting a feel for what's possible.