Hacker News new | past | comments | ask | show | jobs | submit login
Visualize Python, Java, JavaScript, TypeScript, Ruby, C, and C++ Code Execution (pythontutor.com)
317 points by kercker on Feb 29, 2016 | hide | past | favorite | 18 comments



Here are some related links:

Demo of Python Tutor being used in a computer science textbook: http://www.composingprograms.com/pages/17-recursive-function...

The textbook above is from the introductory computer science course at UC Berkeley (http://cs61a.org)

Previous Discussion (~3 years ago): https://news.ycombinator.com/item?id=4601478

If you are interested in the technical details of CPython, the author posted a mini course on technical details about CPython here: http://pgbovine.net/cpython-internals.htm

1 hour podcast that describes the course: https://talkpython.fm/episodes/show/22/cpython-internals-and...


thanks for the links!

i should do a much better job consolidating and advertising all of these resources, but time is never on my side :) so i figure that i'll just keep putting more stuff up and let google figure it out for now.


Do people really need all that text (in the textbook) to understand what a recursive function is?


Yes, recursion is an extremely challenging topic for novices. Beware of the expert blind spot, in which experts such as yourself drastically underestimate how difficult concepts are for novices to learn:

http://teaching.colostate.edu/tips/tip.cfm?tipid=181


Phillip Guo, the creator of this software is also the author of a very nice book called The Ph.D. Grind. I would definitely recommend reading it. http://www.pgbovine.net/PhD-memoir.htm


Seeing the execution as a 2D representation reminds me a bit of Subtextual. @pgbovine: I wonder whether you've seen this. Thinking of higher dimensional representations of code has led me to think that our current way of programming is still stuck in a world heavily influenced by terminals, even given the most modern programming language. Alan Kay's work also seems to go into a direction that tries to break out of this 1D world.


Very nice!

It would be cool if there are examples can help visualize more advance concept such dead lock, semaphore, mutex operations, GL/EGL APIs and shader programming.


Here are some books that use this tool:

http://runestoneinteractive.org/library.html

- How to Think Like a Computer Scientist: Interactive Edition

- CS for All

- Problem Solving with Algorithms and Data Structures Using Python

- Everyday Python

- Java For Python Programmers

- Java Review for the AP CS A Exam

- Java Review

- Programs, Information, and People

- Course Reader - CS160

- Fundamentals of Web Programming

- CS Principles: Big Ideas in Programming


definitely! i'm generalizing the underlying API to be more generic so that people can plug in custom visualizations like those you mentioned.


Very cool, a quick JS example using Addy's memoize function: http://goo.gl/TUldBl

I could see using this to help junior engineers visualize code flow before showing them how to step through code in Chrome dev tools


Your sample is a bit broken and it took me some time to find out what is broken. The memoized function is not actually returning anthing, so caching is not possible. Also it has a side effect (console.log), so the second call won't log. A better sample would be a method with a complicated, expensive calculation.

Fixed version: http://goo.gl/fAyqcV


PythonTutor is a good site.

I had come across a few other similar ones earlier. codingbat.com is one:

http://jugad2.blogspot.in/2013/02/codingbat-progress-graphs-...

The Michael Jordan quote mentioned in that post is a good and inspiring one :)

I recommend those sites to programming beginners who sometimes ask me for resources about Python - but only to start and/or as a supplement. Nothing can make up for getting the full experience of using Python (or any language) in a desktop computer environment, command line, tools, etc.


Very cool.

Now if only it would show cache misses as a button you have to click 400 times before you can continue.


Wow I needed this last week! I was tutoring and I wanted to get this point across using IDLE! Gave up and used PyCharm (made things worse).

Gonna keep this bookmarked for later...


This is really really cool. As a Java developer, this really helps me understand the "magic" of Javascript a bit better.


Same for me, as a Javascript developer. Who knew setTimeout was just setInterval with the internal _repeat flag set to false? Actually, I probably should have known that...


Any chance to have other languages supported? I'm thinking about PHP here for instance.

As I plan to write a blog that would involves PHP code, that could be a nice interactive addition.


It seems static. I expected something dynamic with a VM or emscripten.

BTW interesting work!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: