Skip to content
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

Persisting small dictionaries might be broken #86

Open
acbart opened this issue May 16, 2020 · 0 comments
Open

Persisting small dictionaries might be broken #86

acbart opened this issue May 16, 2020 · 0 comments
Labels

Comments

@acbart
Copy link
Contributor

acbart commented May 16, 2020

In BlockPy's compiler, it seems like it is possible for small dictionaries to be reset. In particular, this was triggered during the Text Adventure game project. Here's a note with a kludge to let students get by the issue, which might offer some suggestions as to what's wrong (you can use tag_phase_3.py as a test case, it's triggered by that).

This is definitely a bug in the underlying execution engine for BlockPy. I don't understand the bug, but I've got it pretty narrowed down. Without getting into details, you just need to make sure that your World has at least two fields. It doesn't even matter what the second field is, it can apparently be an int named "banana", and it will work just fine. So the solution for the students is "ignore that error and go onto the next phase" since they immediately define a second field in the next section.
I'll be honest, I don't really know what the issue could be. This has to be something deep in the compiler that's going wrong - my suspicion is that BlockPy's compiler (which is named Skulpt) is doing some kind of incorrect optimization with "small" dictionaries, where it doesn't persist them. In effect, when the students' game is quit, it doesn't stick around. I have absolutely no idea why or how, and I don't have time to get into the compiler's inner workings right now, but it's definitely weird.

@acbart acbart added the bug label Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant