New Python simulator UI and library#1
New Python simulator UI and library#1isaacev wants to merge 51 commits intodaniel3735928559:masterfrom
Conversation
+ escape `<` and `>` characters + use tabs instead of triple spaces + add spaces and blank lines for readability
+ shares the main stylesheet with the embedded simulators + shares most JS scripts with the embedded simulators
+ arrays + string, array subscript notation
+ print calls go back to outputting only the first argument
|
This looks awesome! I'd rather wait on merging until I have factored out the simulator entirely into an AngularJS directive, as this will make configuration much cleaner and leave room for things like "make this instance not allow functions". I planned to do that this week but it's now looking more like next week. In the meanwhile, some nits:
|
|
I'll work on getting some of your suggestions implemented soon. I just have a couple of questions:
|
|
Officially the only array function that was covered in class was + for concatenation. I additionally support The way I currently handle returns is that you can return nothing, but then using the function call in an expression will create an error. For example, Whether omitting the return statement should be allowed is a question, but it probably doesn't matter either way. |
+ constant DOM manipulation slows down fast program execution
Conflicts: sim/py/python_full.html
|
Should the simulator changes be moved to the Spy repo? |
|
I think here is right. What I've tried to do with the reorg is spin off spy as a separate project that is included and loaded in like any other third-party library (CodeMirror, for example). (I know I haven't quite got around to expressing this properly with a package.json and npm dependencies, but that's the eventual goal.) My thinking on this PR is to add in MiniPy as another library, replace all references to spy with references to MiniPy, and, ideally, remove the spy dependency entirely. (I guess in that world, spy will continue to exist, but I can mark it deprecated and make it a pointer. And this way, in the ideal future you can maintain the MiniPy npm package separately and discovering-cs can just depend on it.) To this end, the simplest thing would be to wrap MiniPy in an Angular directive, say Then the files can go in /lib/MiniPy/minipy.js and similar, whereupon changing the A quick glance leaves me unsure that mimicking that interface verbatim really makes sense, but have a look and we'll see if we can figure out something close. |
Includes:
To do: