AST NodeVisitor for Skulpt gist

42 views
Skip to first unread message

Austin Bart

unread,
Apr 5, 2016, 10:40:00 PM4/5/16
to Skulpt
I translated some code from ast.py to be Skulpt compatible. This gist should hopefully demonstrate walking a Skulpt parse tree. You can subclass the NodeVisitor and create your own tree walkers.


Useful docs from the Python side would be Green Tree Snakes: http://greentreesnakes.readthedocs.org/en/latest/index.html

Feel free to suggest corrections and improvements. This is hopefully gonna power a cool new feature for BlockPy, but it's just a first draft.

Sebastian Silva

unread,
Apr 3, 2017, 1:45:54 PM4/3/17
to Skulpt
Hi Austin!

Nice to find you again! I was a fan of using your Spyral Pygame library on Sugar!

This looks interesting! I was working on a Python-in-a-browser approach and BlockPy looks very interesting as something I'd like to explore. This looks like it might help make a decent debugger / code analyzer (like thonny).

I might switch to Skulpt from RapydScript-ng if it proves fruitful.

My project is:
Sebastian

El martes, 5 de abril de 2016, 21:40:00 (UTC-5), Austin Bart escribió:
I translated some code from ast.py to be Skulpt compatible. This gist should hopefully demonstrate walking a Skulpt parse tree. You can subclass the NodeVisitor and create your own tree walkers.

Austin Bart

unread,
Apr 4, 2017, 9:23:32 AM4/4/17
to Skulpt
Long time no see, Sebastian! I'm sad that Spyral is kind of defunct now - my graduate studies have prevented me from working on it more. I have some hope of implementing a spyral or pygame API into BlockPy someday, but that's pretty far away unfortunately.

BlockPy's goal is to be an excellent introductory environment for Python, so having better debugging tools on our roadmap. Right now, there is a way to trace code, but it's not as sophisticated as Thonny or PythonTutor, if memory serves.

Skulpt is awesome, but it might not fill the same gap as RapydScript. I don't know what you used RapydScript for, but Skulpt's awesomness is that it very closely emulates a real python environment in the client, and is even hackable if you want to add better debugging and stuff. If you were trying to build a complex web-app in Python, I wouldn't necessarily recommend using Skulpt. If you want more of the former than the latter, I can strongly recommend Skulpt! But I think there are more knowledgeable people on this forum who can talk about that :)
Reply all
Reply to author
Forward
0 new messages