Skip to content

Commit cd6e78f

Browse files
committed
Update project-ideas.md
1 parent ca76e3e commit cd6e78f

1 file changed

Lines changed: 49 additions & 83 deletions

File tree

‎v3/docs/project-ideas.md‎

Lines changed: 49 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Project Ideas
22

3-
This document provides an overview of some project ideas for extending
3+
This (messy!) document provides an overview of some project ideas for extending
44
Online Python Tutor (thereafter abbreviated as OPT). View it online at:
55

66
https://github.com/pgbovine/OnlinePythonTutor/blob/master/v3/docs/project-ideas.md
@@ -9,9 +9,9 @@ Email philip@pgbovine.net if you're interested in working on anything here, or i
99
project ideas.
1010

1111

12-
# Stylistic
12+
## Stylistic
1313

14-
## Beautiful print-outs of OPT visualizations
14+
### Beautiful print-outs of OPT visualizations
1515

1616
A lot of instructors want to print out their OPT visualizations to make handouts or lecture notes
1717
for students.
@@ -26,7 +26,7 @@ Another idea is to get OPT to output SVG, PDF, or another
2626
printer-friendly format.
2727

2828

29-
## Responsive web UI design for OPT frontend
29+
### Responsive web UI design for OPT frontend
3030

3131
This is a good project for someone interested in visual and web design.
3232

@@ -35,9 +35,9 @@ so that OPT visualizations (and the surrounding user interface) look good on dis
3535
ranging from smartphones to tablets to laptops to giant desktop monitors.
3636

3737

38-
# Frontend
38+
## Frontend
3939

40-
## Rich user input widgets
40+
### Rich user input widgets
4141

4242
Right now Online Python Tutor takes only code as input. However, it would be great to create widgets that allow
4343
the user to input data into their code. That way, they can visualize the same code executing on different data
@@ -55,7 +55,7 @@ Here are some examples of input widgets:
5555
- A text box that represents a file on the filesystem. Imagine a web-based I/O simulator where there would be a text box simulating a file object, and then I/O calls such as open, readline, etc. would be intercepted and visualized as iterating (pointing) to the file object one line at a time, reading each line into a string, etc. Writing into a file can also be visualized in this way too. And seeking, overwriting, appending, etc.
5656

5757

58-
## Custom data structure visualizations
58+
### Custom data structure visualizations
5959

6060
Right now Online Python Tutor can render only basic Python data structures.
6161

@@ -83,7 +83,7 @@ There are (at least) two main ways to implement this feature:
8383
The dream is to be able to write Python modules for each custom data type.
8484

8585

86-
## Custom Rendering API and Lightweight Plug-In System
86+
### Custom rendering API and plugin system
8787

8888
Right now Online Python Tutor renders Python data structures in a single, fixed way.
8989
However, different instructors have different preferences for how they want certain objects to render
@@ -98,7 +98,7 @@ The ultimate goal here is to completely replace one-off custom algorithm visuali
9898
and ad-hoc PowerPoint slide deck animations of CS concepts.
9999

100100

101-
## Annotations for simplifying visualizations
101+
### Annotations for simplifying visualizations
102102

103103
Right now OPT visualizes "everything" about program execution. However, that can easily lead to visual overload.
104104
Let's think about implementing annotations to selectively show/hide different parts of execution, so that instructors
@@ -123,10 +123,12 @@ lying around.
123123
Think about how annotations can "clean up" such a big and hairy visualization.
124124

125125

126-
## Authoring environment for programming exercises and quizzes
126+
### Authoring environment
127127

128+
With a proper authoring environment,
128129
Online Python Tutor visualizations could become a basis for annotated examples, programming exercises, and quizzes.
129130

131+
130132
**Annotated code visualizations**:
131133

132134
- Teachers to use as a place to put their code examples and mini-lessons (so that they’re persistent, rather than sending out a bunch of gross URLs)
@@ -146,79 +148,10 @@ and the user would need to fill in those slots with the appropriate values. (The
146148
not-yet-documented prototype of these sorts of pop-up questions, done by Brad Miller.)
147149

148150

149-
# Backend
150-
151-
## Offline mode for use as a production debugger
152-
153-
From a reader comment: "As a teaching tool it is invaluable, not only for teaching python, but for programming in general (what is going on in memory...).
154-
I've actively used it to debug / trace short pieces of code. Any chance of having it offline (and without the limitations of an online tool like the inability to load all modules)? That would make a perfect pdb visualization tool."
155-
156-
You could imagine running a webserver on localhost and using OPT as a graphical frontend for pdb; interesting idea!
157-
158-
Notes from an email I sent on 2012-10-24: {
159-
160-
One possible offline application is to use OPT as a visual debugger for pdb (http://docs.python.org/library/pdb.html). The use case here would be:
161-
162-
1.) The user launches a special version of pdb augmented with OPT.
163-
2.) The user types in some Python command to visualize.
164-
3.) pdb starts a local webserver and pops up a web browser window.
165-
4.) The visualization appears in the web browser window, and the user can interact with it.
166-
167-
Actually, now that I think about it, you can start even simpler without pdb. Here is an even simpler starting point:
168-
169-
1.) The user writes some code to visualize in a file on his/her computer.
170-
2.) The user runs a special Python script that runs OPT on that file, launches a local webserver, and pops open a web browser window.
171-
3.) The visualization appears in the web browser window.
172-
173-
Ok, that seems simpler as a starting point, and it will still teach you about local webservers and interfacing between the OPT backend and frontend.
174-
175-
Then comes the question of why this offline mode might be useful (beyond being a good learning exercise). After all, just by following the directions in the developer overview docs, you've essentially set up OPT to run offline without an Internet connection. So my plan above doesn't give you any extra functionality. However, I think the potential lies in integrating with a real debugger such as pdb, so that you can run large Python programs, pause execution, and then visualize selected data structures (rather than all data structures in the program, which can get overwhelming).
176-
177-
Ok sorry that was mostly me thinking out loud.
178-
179-
}
180-
181-
Ha, I guess you can call this **"Offline Python Tutor"**!
182-
183-
184-
## Add better Unicode support
185-
186-
This project is a great fit for someone familiar with coding in non-English languages.
187-
188-
Right now, OPT has poor-to-nonexistent Unicode support, so adding it is important for making it friendlier to
189-
non-English audiences.
190-
191-
Here is one bug report that inspired this project idea:
192-
193-
"""
194-
I’m having some fun with your nifty Python visualiser.
195-
While trying too see what happens in Unicode strings are processed,
196-
I encountered some odd little quirks such as a unicode character
197-
being replace with a string representation of a Unicode code point
198-
number in denary.
199-
151+
## Backend
200152

201-
<a href="http://www.pythontutor.com/visualize.html#code=s+%3D+unicode(0x2015)%0Aa+%3D+'Myer'+%2B+s+%2B+'Briggs'%0Ax+%3D+a.index(s)%0Al+%3D+a%5B%3Ax%5D%0Ar+%3D+a%5Bx+%2B+len(s)%3A%5D%0Aprint+l%0Aprint+r%0Aprint+'%22'+%2B+a+%2B+'%22+is+'+%2B+str(len(a))+%2B+'+characters+long.'%0Afor+i,+z+in+unumerate(a)%3A%0A++print+'a%5B'+%2B+str(i)+%2B+'%5D+%3D+'+%2B+str(z)&mode=display&cumulative=false&py=2&curInstr=8">click to visualize code snippet</a>
202153

203-
Changing the first line to
204-
205-
```python
206-
s = u'\u2015'
207-
```
208-
209-
Causes an “unknown error” to be reported, as does the insertion of unicode characters like “—” (em dash) in string literals.
210-
211-
The following code causes the interpreter to hang.
212-
```python
213-
# -*- coding: utf-8 -*-
214-
s = u'—'
215-
```
216-
"""
217-
218-
(Note that Unicode support in Python 2 and 3 involve different subtleties.)
219-
220-
221-
## Visualizing different programming languages (especially JavaScript!)
154+
### Visualizing different programming languages (especially JavaScript!)
222155

223156
This project is great for someone who likes to hack on language implementations and runtimes.
224157

@@ -254,7 +187,7 @@ trace generator for C and C++.
254187
It should be much easier to build a backend for a memory- and type-safe language, though :)
255188

256189

257-
## Skulpt (Python-in-JavaScript) backend
190+
### Skulpt (Python-in-JavaScript) backend
258191

259192
This project is appropriate for someone with advanced knowledge of hacking a Python interpreter
260193
who is willing to make a substantive time commitment.
@@ -286,7 +219,40 @@ Tips & Tricks:
286219

287220
Dec 2012: Brython -- http://www.brython.info/index_en.html -- might also be a contender here, since it supports lots of Python 3 (except for OOP, lambdas, exceptions, and generators, afaik).
288221

289-
May 2013: The main caveat with re-implementing for one of these alternative Python implementations is that they don't support the full ("official") Python language.
222+
May 2013: In the experience of Python veterans, the main caveat with targeting one of these alternative Python implementations is that they don't support the full ("official") Python language.
290223
Thus, users might be frustrated that code they type into this tutor doesn't run exactly like code they type into the official Python interpreter.
291224
That said, though, a Skulpt implementation would still be useful, as long as users understand its limitations and caveats, and that it doesn't support the full Python language in all of its glory (or its weird edge-case behaviors).
292225

226+
227+
### Offline mode for use as a production debugger
228+
229+
From a reader comment: "As a teaching tool it is invaluable, not only for teaching python, but for programming in general (what is going on in memory...).
230+
I've actively used it to debug / trace short pieces of code. Any chance of having it offline (and without the limitations of an online tool like the inability to load all modules)? That would make a perfect pdb visualization tool."
231+
232+
You could imagine running a webserver on localhost and using OPT as a graphical frontend for pdb; interesting idea!
233+
234+
Notes from an email I sent on 2012-10-24: {
235+
236+
One possible offline application is to use OPT as a visual debugger for pdb (http://docs.python.org/library/pdb.html). The use case here would be:
237+
238+
1.) The user launches a special version of pdb augmented with OPT.
239+
2.) The user types in some Python command to visualize.
240+
3.) pdb starts a local webserver and pops up a web browser window.
241+
4.) The visualization appears in the web browser window, and the user can interact with it.
242+
243+
Actually, now that I think about it, you can start even simpler without pdb. Here is an even simpler starting point:
244+
245+
1.) The user writes some code to visualize in a file on his/her computer.
246+
2.) The user runs a special Python script that runs OPT on that file, launches a local webserver, and pops open a web browser window.
247+
3.) The visualization appears in the web browser window.
248+
249+
Ok, that seems simpler as a starting point, and it will still teach you about local webservers and interfacing between the OPT backend and frontend.
250+
251+
Then comes the question of why this offline mode might be useful (beyond being a good learning exercise). After all, just by following the directions in the developer overview docs, you've essentially set up OPT to run offline without an Internet connection. So my plan above doesn't give you any extra functionality. However, I think the potential lies in integrating with a real debugger such as pdb, so that you can run large Python programs, pause execution, and then visualize selected data structures (rather than all data structures in the program, which can get overwhelming).
252+
253+
Ok sorry that was mostly me thinking out loud.
254+
255+
}
256+
257+
Ha, I guess you can call this **"Offline Python Tutor"**!
258+

0 commit comments

Comments
 (0)