Summer of Code/2013/Turtle Blocks Python export project: Difference between revisions
Marion Zepf (talk | contribs) m formatting |
Marion Zepf (talk | contribs) highlight link to final report |
||
| (10 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
The mentors for this project are [[User:Walter|Walter Bender]] and [http://wiki.laptop.org/go/User:Claudia_Urrea Claudia Urrea]. | The mentors for this project are [[User:Walter|Walter Bender]] and [http://wiki.laptop.org/go/User:Claudia_Urrea Claudia Urrea]. | ||
The summer is over, so I have written a '''[[Media:Final_Report_on_Turtle_Blocks_Python_export.pdf|final report]]''' on my project. It gives an overview of the task, my ideas and their implementation, as well as the final status of the project. | |||
== Repositories == | == Repositories == | ||
I develop my project in a | === gsoc-python-export on gitorious === | ||
I develop my project in a repository called [https://git.sugarlabs.org/~mzepf/gsoc-python-export gsoc-python-export] in the SugarLabs Gitorious system. If you would like to have a look at my latest progress, check out the <code>primitive-class</code> branch. It contains the latest '''stable''', i.e. working, version of TurtleArt and the export tool. | |||
The branch <code>type-system</code> contains some work-in-progress on the type system for <code>Primitive</code> objects that I am currently introducing. It's a major change that affects how blocks are executed and exported to ASTs. Therefore, this branch should be considered '''unstable''', i.e. there is no guarantee that things will work or even that you'll get useful error messages. As soon as the type system is fully established and everything works again, this branch will be merged back into <code>primitive-class</code>. | |||
The <code>master</code> branch is only used for submitting merge requests to [https://git.sugarlabs.org/turtleart/mainline the main TurtleArt repository]. | |||
=== ta-python-export-dev on github === | |||
Design documents, sample code, etc. go into [https://github.com/outofthecave/ta-python-export-dev ta-python-export-dev] on GitHub. There, the <code>master</code> branch is the most recent one. | |||
== Timeline == | == Timeline == | ||
The following timeline | The following timeline is being modified as the project evolves. | ||
* 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. Only cover the modules that are necessary to run blocks from the 'Turtle', 'Pen', and 'Pen colors' palettes. Deal with the other modules when implementing the corresponding blocks. | * 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. Only cover the modules that are necessary to run blocks from the 'Turtle', 'Pen', and 'Pen colors' palettes. Deal with the other modules when implementing the corresponding blocks. | ||
| Line 27: | Line 39: | ||
** August 12 – August 18 (1 week) | ** August 12 – August 18 (1 week) | ||
*** The complete 'Pen colors' palette | *** The complete 'Pen colors' palette | ||
*** Numeric operations from the 'Numeric operators' palette | *** Numeric operations from the 'Numeric operators' palette | ||
*** Variables from the 'Action stacks' palette | *** Variables from the 'Action stacks' palette | ||
*** Action stacks (functions) from the 'Action stacks' palette | *** Action stacks (functions) from the 'Action stacks' palette | ||
** August 19 – August 25 (1 week) | ** August 19 – August 25 (1 week) | ||
*** | *** Write a tutorial on how to define a <code>Primitive</code> for a new block, so other TA (plugin) developers can make their blocks exportable. | ||
*** | *** Introduce strong typing to <code>Primitive</code>s. | ||
*** | *** Pass argument blocks to the functor as <code>Primitive</code> objects, not as ASTs or return values of a function call. | ||
** August 26 – September 1 (1 week) | ** August 26 – September 1 (1 week) | ||
*** Introduce disjunctions of <code>Type</code>s, <code>ArgSlot</code>s, argument lists, and <code>Primitive</code>s. | |||
*** Adjust the export functionality to the type system. | |||
*** Start re-writing 'old' <code>Primitive</code>s to make use of the new type system. | |||
*** Write new documentation about how to create a new block, including creating new <code>Primitive</code>s. | |||
*** Comments from the 'Extra options' palette: This is especially difficult because Python's <code>ast</code> module does not support comments natively. | *** Comments from the 'Extra options' palette: This is especially difficult because Python's <code>ast</code> module does not support comments natively. | ||
** September 2 – September 8 (1 week) | ** September 2 – September 8 (1 week) | ||
*** Events and user input from the 'Sensors' palette | *** Screen dimensions from the 'Presentation templates' palette | ||
*** Runtime control (e.g., exit, suspension) from the 'Flow operators' palette | |||
*** Heaps from the 'Extra options' palette | |||
** September 9 – September 15 (1 week) | |||
*** External functions (chr, int, mathematical function, tamyblock.py) from the 'Extra options' palette | |||
*** Events and user input from the 'Sensors' palette | |||
*** Sounds and sprites from the 'Media' palette | *** Sounds and sprites from the 'Media' palette | ||
*** Display management (hide/ show blocks, toggle full screen) from the 'Presentation templates' palette | *** Display management (hide/ show blocks, toggle full screen) from the 'Presentation templates' palette | ||
* September 16 – September 23 (1 week): Test exporting different kinds of blocks in combination. Fix the last bugs. Clean up. | * September 16 – September 23 (1 week): Test exporting different kinds of blocks in combination. Fix the last bugs. Clean up. | ||
== Decisions == | == Decisions == | ||
| Line 63: | Line 75: | ||
* All blocks (including the ones introduced by plugins) reference a <code>Primitive</code> object, which can be called to execute the block in TA, or transformed into a Python AST. | * All blocks (including the ones introduced by plugins) reference a <code>Primitive</code> object, which can be called to execute the block in TA, or transformed into a Python AST. | ||
** Type conversion and other modification of the arguments of a block is done by ''slot wrappers''. A slot wrapper is a <code>Primitive</code> that is attached to the argument of another <code>Primitive</code>. Slot wrappers are called/ transformed before the <code>Primitive</code> itself. | ** Type conversion and other modification of the arguments of a block is done by ''slot wrappers''. A slot wrapper is a <code>Primitive</code> that is attached to the argument of another <code>Primitive</code>. Slot wrappers are called/ transformed before the <code>Primitive</code> itself. | ||
* The status bar may be shown when the exported code is run, as is necessary and appropriate during execution. | |||
=== Pending === | === Pending === | ||
| Line 74: | Line 87: | ||
* Enable the user to control the speed of execution (e.g., by setting a global <code>step_time</code>)? | * Enable the user to control the speed of execution (e.g., by setting a global <code>step_time</code>)? | ||
** How to implement this? E.g., call a <code>wait(step_time)</code> function in between two steps? | ** How to implement this? E.g., call a <code>wait(step_time)</code> function in between two steps? | ||