-
Notifications
You must be signed in to change notification settings - Fork 78
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
"Beyond finishing" ideas #18
Comments
Hi, is there also any plans for :
My questions are relative to a possible support of wasi/wasm unthreaded platform that does not seem to get any echo elsewhere. |
That's what I'd like to do, yes. But given that the work started in MicroPython, it's only logical to wait when then need for it will dawn (well, set) on its maintainer and he will merge the pending patch. Doing concurrent work means doing potentially useless work, to be overthrown by merge conflicts later.
There's implementation of "stackless" mode, implemented by me years ago, which would be just that, depending on what exactly you mean.
I personally didn't have need for that so far, and the idea of uasyncio to be minimal. I would conjecture that per-coroutine data storage can be already implement, as a separate module. |
if keeping the current VM design it makes perfect sense. But i'm really not sure the current design fits
i mean extending : Your stackless implementation for loop iteration and removing the dependency on c-stack for recursives calls starting from this point https://github.com/pfalcon/pycopy/blob/master/py/vm.c#L201 to allow some level of pre-emption when micropython loop is called from a host program. ie using a seperate C static context for each level of recursive calls to mp_execute_bytecode and iterators. i know It's a lot of work cause i tested that already ( and it can work ) but the struct to hold the callpath and data for what is usefull to preempt is small.
i guess contextvars could be linked to the C context + callpath + pystack , maybe to facilitate multi core exchanges later. Making it one of the best Python implementations instead of a better something. |
That's exactly what I implemented in 2015: 2039757. Of course, C stack is not used only when Python bytecode is executed. As soon as native (C) function is called, it uses C stack, then if it calls back into Python code, that opens another (big) stack frame for mp_execute_bytecode().
They can be implemented in pure Python. In a distant imaginary future they might be optimized beyond that. |
yes, by extending the concept i mean not using c-stack when python bytecode execution is paused |
no sorry, it did not work "as is" on clang/wasm targets because it was probably not complete enough up to top level vm entry, the working way was for me PYSTACK + handling cstack from the first module fun_0 call. That's why i'm asking your position regarding finishing no_nlr/c-stackless and your current codebase.
sub interpreters are not in a distant imaginary future. they are seeded in since 3.7.0 |
But clang/wasm is your personal fixation, for everyone else it's just another feature among myriad of others. (It's definitely buzzwordy feature, thanks to marketing departments of big media corporations, but to give it fairness, marketing campaign for Java applets in browsers was much more cooler. (Or I was younger and grass was greener.)). You would need to convert your "probably" into "proven with a reproduction testcases applied to a general case, not just 'clang/wasm' ".
No news here beyond recent comments above. Stackless is complete, unless proven otherwise. NLR removal is handled in upstream, and I have gazillion of other things to do, so don't compete. When I run out of things to do (~several years), and upstream is still not there, I'll do it myself. (Unless I'll switch to finishing ;-) ). |
clang/wasm was as an example you can easily check with public tools at no cost on the poor broken "javascript port" you host yourself. My others "week-end coder" fixations are maybe none of your concern or for public display. Sidenote the number of wasm devices actually vastly outrank any other toy mcu you can/want/try to support. i'm done here thank you for your time. |
The reason I quit micropython - I'm not interested to spend my life on toy mcus. I'm interested in a minimalist language, which includes protecting its minimalism from all the parties who want to bloat it up on their whims. Good news re:"vast rank of wasm devices" is that those devices can also run something else besides wasm, at least so far. But in distant imaginary future, when they lock us out to only wasm, your work will be of utter importance. So, please keep it up, and make it great. |
Things to consider beyond #15.
+=
(as a synonym for .write()) and[]
operations foruio.StringIO
, effectively implementing "string buffer" class with operations close tostr
.+=
, etc. operations to array.array as means for users to perform alloc-free arithmetics on values "larger" than native smallint (e.g. on int32, int64, float, double values).The text was updated successfully, but these errors were encountered: