Summer of Code/2013/Turtle Blocks Python export
My name is Marion Zepf and I would like to work on the project Python export funtionality for TurtleBlocks. Please find my application below.
About me
What is your name?
Marion Zepf
What is your email address?
What is your Sugar Labs wiki username?
What is your IRC nickname?
I do not have a fixed nickname, but I try to use "mzepf" if it is available.
What is your primary language?
(We have mentors who speak multiple languages and can match you with one of them if you'd prefer.)
My native language is German, but I am more comfortable in English when it comes to computers and programming.
Where are you located, and what hours do you tend to work?
(We also try to match mentors by general time zone if possible.)
I am located in Stuttgart and Tübingen, Germany. My time zone is Central European Summer Time (CEST) or UTC+02:00 during summer. I plan to work on this project Thu-Sun, approximately from noon until midnight.
Have you participated in an open-source project before?
If so, please send us URLs to your profile pages for those projects, or some other demonstration of the work that you have done in open-source. If not, why do you want to work on an open-source project this summer?
This is my first open-source project. In the past, I have benefitted from open-source software countless times. Now I want to give something back to the community.
About my Project
Project description
What is the name of your project? Describe your project in 10-20 sentences. What are you making? Who are you making it for, and why do they need it? What technologies (programming languages, etc.) will you be using?
Turtle Blocks Python export lets the user export their programming project from the Turtle Blocks activity to a Python script. The generated Python code can be run outside of Turtle Blocks, for example from the command line or in the Pippy IDE.
This tool is designed for users who are already proficient Turtle Block programmers and want to move on to text-based programming. It helps them transfer their knowledge and skills from block-based to text-based programming, as they can see their own creations in a new programming language. Thus, they can focus on the new language rather than the content of the program.
The Python export functionality will be implemented in pure Python, drawing on the internal block code interpreter of Turtle Blocks to convert the blocks to a representation of the program flow. I will then use the ast
module[1] to build the Python syntax tree from this representation. In order to serialize the syntax tree to a string, which can then be written to a file, I plan to use either the codegen
module[2][3] or the unparse
module.[4]
The exported Python code will need to import a few classes from Turtle Blocks to set up a window etc. I will isolate these classes from the Turtle Blocks code, so it can easily be imported into the generated code.
What is the timeline for development of your project?
The Summer of Code work period is June 17 - September 23; tell us what you will be working on each week. (As the summer goes on, you and your mentor will adjust your schedule, but it's good to have a plan at the beginning so you have an idea of where you're headed.) Note that you should probably plan to have something "working and 90% done" by the midterm evaluation (August 2); the last steps always take longer than you think, and we will consider cancelling projects which are not mostly working by then.
- June 17 – June 30 (2 weeks): Determine what code needs to be shared by Turtle Blocks and the exported code. Restructure the modules to isolate this part, so it can easily be imported. This only covers the modules that are necessary to run blocks from the 'Turtle', 'Pen', and 'Pen colors' palettes. The other modules will be dealt with when the corresponding blocks are implemented.
- July 1 – July 21 (3 weeks): Implement the first transformations from blocks to Python code. This will only cover the following blocks from the 'Turtle' palette: 'forward', 'back', 'left', and 'right'. Make sure the exported code imports the correct modules from Turtle Blocks and can be run on the command line (or in Pippy). Keep the implementation modular, so more blocks can be added easily.
- July 22 – July 28 (1 week): Rest of the 'Turtle' palette, and complete 'Pen' and 'Pen colors' palettes. These should be similar enough to the first four blocks that they can be implemented quickly.
- July 29 – August 2: Midterm evaluation: Block programs can be exported to Python code that can be run outside of Turtle Blocks. The export functionality is limited to blocks from the 'Turtle', 'Pen', and 'Pen colors' palette, but it can easily be extended to cover the other blocks.
- August 3 – September 15 (6 weeks): Implement transformations of all other blocks to Python code:
- Numeric operations from the 'Numeric operators' palette and screen dimensions from the 'Presentation templates' palette
- Boolean operations from the 'Numeric operators' palette and conditionals from the 'Flow operators' palette
- Variables and functions from the 'Action stacks' palette
- Loops from the 'Flow operators' palette
- Heaps from the 'Extra options' palette
- Runtime control (e.g., exit, suspension) from the 'Flow operators' palette
- External functions (chr, int, mathematical function, tamyblock.py) from the 'Extra options' palette
- Comments from the 'Extra options' palette: This is especially difficult because Python's
ast
module does not support comments natively. - Events and user input from the 'Sensors' palette
- Sounds and sprites from the 'Media' palette and presentation templates from the 'Presentation templates' palette
- Multiple turtles and custom turtle shells from the 'Extra options' palette
- Display management (hide/ show blocks, toggle full screen) from the 'Presentation templates' palette, and printing and loading blocks and palettes from the 'Extra options' palette: These are very specific to Turtle Blocks. We need further discussion how this should look in the output of the exported Python code.
My Backround
Convince us, in 5-15 sentences, that you will be able to successfully complete your project in the timeline you have described. This is usually where people describe their past experiences, credentials, prior projects, schoolwork, and that sort of thing, but be creative. Link to prior work or other resources as relevant.
Me and the Community
Impact on the Sugar Labs community
If your project is successfully completed, what will its impact be on the Sugar Labs community? Give 3 answers, each 1-3 paragraphs in length. The first one should be yours. The other two should be answers from members of the Sugar Labs community, at least one of whom should be a Sugar Labs GSoC mentor. Provide email contact information for non-GSoC mentors.
Sugar pilot deployment
Sugar Labs will be working to set up a small (5-30 unit) Sugar pilot near each student project that is accepted to GSoC so that you can immediately see how your work affects children in a deployment. We will make arrangements to either supply or find all the equipment needed. Do you have any ideas on where you would like your deployment to be, who you would like to be involved, and how we can help you and the community in your area begin it?
What will you do if you get stuck on your project and your mentor isn't around?
Keeping the community informed about problems and questions
How do you propose you will be keeping the community informed of your progress and any problems or questions you might have over the course of the project?
Miscellaneous
Screenshot of my Sugar development environment
We want to make sure that you can set up a development environment before the summer starts. Please send us a link to a screenshot of your Sugar development environment with the following modification: when you hover over the XO-person icon in the middle of Home view, the drop-down text should have your email in place of "Restart." See the image on the right for an example. It's normal to need assistance with this, so please visit our IRC channel, #sugar on irc.freenode.net, and ask for help.
What is your t-shirt size?
(Yes, we know Google asks for this already; humor us.)
S (female)
Describe a great learning experience you had as a child.
Additional information
Is there anything else we should have asked you or anything else that we should know that might make us like you or your project more?