-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
MicroPython and emscripten #3474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @LeaNumworks, nice work with your simulator!
Myself and a colleague have also lately been working on an Emscripten port and came across these two issues as well. The first is easy to fix and we can provide a compile-time option in uPy to select the stack direction. We could not fix the second issue yet, with the GC. We have a build of uPy that runs under node (eg
I'm definitely interested in having an Emscripten port, but the GC issue is a real show stopper at this point. |
I agree that having a working GC is a priority. We only really did three things:
We did not run the uPY test-suite on our port so we may indeed be missing something. That being said, it does a great job for our use-case and the few scripts we tried this on did not seem to be leaking memory. |
@LeaNumworks Would you mind sharing your branch? In case fixing the garbage collector properly is a huge headache, how about having a naive implementation of https://github.com/micropython/micropython/blob/master/py/gc.c for Emscripten port for now and migrating to WebAssembly/design#1079 in the future when it's ready? |
@LeaNumworks Oh, I guess it's https://github.com/numworks/epsilon/tree/master/python nvm |
Nice! I had put a bounty on #888 (comment) to get something like this done. Not that $100 USD could possibly cover the costs, but is more about an incentive to get it rolling. Thanks very much for your effort. |
@LeaNumworks I'm trying to run uPy test suite with https://github.com/numworks/epsilon/tree/master/python , but looking at port/ , it looks like it has other dependencies like Ion. Is there an easy way to just run on desktop? I was thinking maybe I should use the default port/unix instead but I'm not that familiar with Micropython porting layer. Thanks. |
nvm I took some time to read the source code and have a better understanding of the structure now. I'll ask if I have any further question thanks! |
You can try @LeaNumworks 's stand-alone micropython here https://kkimdev.github.io/epsilon/index.html repo: https://github.com/kkimdev/epsilon |
181 KB download / 665 KB unpacked ! This is nice! |
A port to javascript was added in 7d675f3 |
@LeaNumworks I am currently working on running MicroPython for the micro:bit with emscripten and emterpretify. I have applied your GC fixes, i.e. the descending stack, using setjmp, and I know that optimisations are not applied. Despite this, the GC still sweeps what it shouldn't, specifically, the local code_state pointer in fun_bc_call appears to not be stored in the stack but stored somewhere in emterpreter's local javascript heaps. Am I right in thinking that you also use emterpretify? |
@geowor01 you may want to test with #4723 to see if it helps your case |
Thanks @dpgeorge! That does appear to fix the problem. |
Update TinyUSB to get MIDI SysEx fix
This issue can probably be closed now? The JavaScript port mentioned above has been renamed to WebAssembly, and should be generally functional. Any problems with it should probably be handled in specific issues? |
Appears resolved. |
Hi,
I work on a graphic calculator for the company Numworks. We have a Python app that uses MicroPython. We fixed some issues when using uPY on emscripten and successfully got it running.
Among the issues we found and fixed:
Would you be interested in some PRs to get a working Emscripten build?
(By the way, this could be interesting for issues #3313, #2618 , #1561, #888)
The text was updated successfully, but these errors were encountered: