-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[RFC] Sys builtin module names V2 #4553
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
Conversation
f9990e2
to
f26023f
Compare
Tested on the ESP32. Works (duh) but doesn't handle soft resets very well - after reading the code and realizing how soft resets work, I came to a conclusion that randomly placing global, lazily initialized variables won't work so well... Need to figure out how to do this nicer. Perhaps if there was a special data section that |
Otherwise, the only solution I see is to manually add each item to |
What made you give up on previous approach of compile-time tuple generation? |
You mean #4468? |
Yep. |
Can't say I've given up on it. I still think it's a better approach. But I wanted to gather some more approval before continuing with it, and meanwhile I thought to offer this PR to show another softer, possible way, and see what's favoured more. If you think the first solution is better and viable, I'll continue with it. |
Yes, I personally think that having fully static, ROMable data is better. And this "lazy globals" stuff is too magic. Before going for things like that, we'd rather firsy solve the issue of letting override sys.stdout and friends, I probably already mentioned that. |
Thanks for the attempt @Jongy . You can see that getting all the fine details correct is not easy. The cached list of builtins would need to be stored in the root pointer section (as you found out) making it more complex. And a downside of the approach here is that (with the feature enabled) all modules grow by 1 word, even though most won't use the lazy feature. That could be solved by putting the lazy function pointer in the modules dict (somehow), or making At this point I don't think the utility of having The ROM approach is probably going to be even more complicated, but hard to say until there is a working proof of concept. In the end there may not be an elegant way to implement the feature. |
I agree, basically :) Since this approach really got too complicated, and since I already have a functioning PoC of the ROM approach, I'll close this PR. Back to #4468. |
decompress: Fix decompression when length takes 7 bits
A second approach, as suggested by @dpgeorge in #4468 (#4468 (comment))
Currently tested on unix, didn't test sizes yet / on any other platform.
Happy for comments :)